-
Notifications
You must be signed in to change notification settings - Fork 589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reworked library logging #551
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Should be more descriptive to the users. Changed log levels to better match weights of the messages. TODO: Log individual operation parameters. Check code throwing errors in downstream.
…tted to the user either way
…de after service discovery.
Cierpliwy
reviewed
Mar 15, 2019
rxandroidble/src/main/java/com/polidea/rxandroidble2/RxBleAdapterStateObservable.java
Show resolved
Hide resolved
rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/RxBleLog.java
Outdated
Show resolved
Hide resolved
rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/RxBleLog.java
Show resolved
Hide resolved
rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/RxBleLog.java
Outdated
Show resolved
Hide resolved
rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/logger/LoggerUtil.java
Show resolved
Hide resolved
...roidble/src/main/java/com/polidea/rxandroidble2/internal/operations/LegacyScanOperation.java
Outdated
Show resolved
Hide resolved
rxandroidble/src/main/java/com/polidea/rxandroidble2/LogConstants.java
Outdated
Show resolved
Hide resolved
rxandroidble/src/main/java/com/polidea/rxandroidble2/LogConstants.java
Outdated
Show resolved
Hide resolved
rxandroidble/src/main/java/com/polidea/rxandroidble2/LogConstants.java
Outdated
Show resolved
Hide resolved
…Javadoc with behaviour description.
…egacyScanOperation to LoggerUtil
Cierpliwy
approved these changes
Mar 15, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Revisited and improved all library logging. Main points of different log levels:
NONE
— nothing is loggedERROR
— only errors that make the library to stop working are loggedWARNING
— adds logs about abnormal behaviour of the application that may be handled gracefully and info about wrong usage of the library e.g. trying to read characteristic that does not have a read propertyINFO
— adds all relevant information about what is actually happening with the user's app, i.e. when a specific operation starts to run, what config it has, what callbacks are returned from the systemDEBUG
— adds information that should add information needed for debugging the library, i.e. whenVERBOSE
— adds information about some internal events in the library which may be useful in the debugging processAdditionally added new method for setting logger options
RxBleClient.setLogOptions(LogOptions)
. Knobs:MAC address
— may be omitted (NONE
->XX:XX:XX:XX:XX:XX
), truncated (MAC_ADDRESS_TRUNCATED
->00:11:22:33:44:XX
), full (MAC_ADDRESS_FULL
->00:11:22:33:44:55
)UUID
— may be omitted (NONE
->...
) or full (UUIDS_FULL
->"00002902-0000-1000-8000-00805f9b34fb"
)byte[]
— this is related both to read/written data of characteristics/descriptors as the data in advertisements payload. May be omitted ([...]
) or not ([FF, FF, FF, FF]
— hex values)logger
— sets the logger to be used instead of logging to logcatDeprecated:
RxBleClient.setLogLevel()
RxBleLog.setLogLevel()
RxBleLog.setLogger()
Closes #304
Example of logging full data
Click to expand logs
Example logging minimum data
Click to expand logs