-
Notifications
You must be signed in to change notification settings - Fork 8
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
Modularize: separate the core SLF4J binding from the optional handlers #21
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
azabost
commented
May 3, 2024
core/src/main/java/pl/brightinventions/slf4android/LoggerConfiguration.java
Show resolved
Hide resolved
azabost
commented
May 3, 2024
core/src/main/java/pl/brightinventions/slf4android/LoggerConfiguration.java
Show resolved
Hide resolved
miensol
reviewed
May 6, 2024
core/src/main/java/pl/brightinventions/slf4android/Disposable.java
Outdated
Show resolved
Hide resolved
azabost
commented
May 7, 2024
try { | ||
closeable.close(); | ||
} catch (IOException e) { | ||
Log.e(TAG, "Could not close " + closeable, e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Log.e
is used for consistency with the existing code in this class. Nevertheless, I don't see a reason why SLF4J API shouldn't be used here, so we might as well migrate all Log.e
to Logger.error
sooner or later.
miensol
reviewed
May 10, 2024
miensol
approved these changes
May 10, 2024
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.
The main purpose of this PR is to modularize this library so that the core feature, which is SLF4J binding, can be used without the burden of unnecessary dependencies such as the
FileLogHandler
and theNotifyDeveloperHandler
.Here's a summary of the changes:
app
module into:core
,handler-file-log
,handler-notify-developer
FileLogHandler
)testapp
application module that can be used for testing the other modulessourceCompatibility
andtargetCompatibility
back to 1.8 (my previous PR left them undefined hence they were the same as the configured Java toolchain, which was 17)@TargetApi
occurrences because they were no longer relevant due to a higher min SDK versionDisposable
interface public and expose a publicLoggerConfiguration.registerDisposable
method. These changes were required only to letNotifyDeveloperHandler
work with as few changes as possible. Not sure if we want to keep that functionality in the long run, but I didn't want to remove it just yet. If we decided to get rid of that handler, we could also remove the new public method and theDisposable
interface.