Stoping Using Root Logger with One-off Logging Setup #44
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.
What kind of change does this PR introduce?
Fixes #43. This PR stops using the root logger that makes it difficult for consumers to configure logging for our library and removes the one-off logging configuration from the library which is totally unnecessary.
What is the current behavior?
It's difficult for consumers of the library to configure logging for the library specifically.
Let's assume that a consumer has the following logging setup as they want their
INFO
messages are logged.However, the consumer ends up getting
INFO
messages of our library logged as well as their application logs.This is because our library uses the root logger with a one-off logging setup that configures the root logger to log all
INFO
messages.From the consumer's perspective, this can be annoying because there is no way for them to differentiate their logs from our library logs.
What is the new behavior?
A simple solution is to stop using the root logger and remove the one-off logging setup from the library. Instead, if we use a logger scoped to the package namespace, consumers will be able to configure logging for the library differently from the rest of their application.
Does this PR introduce a breaking change?
This PR will only affect consumers who use subscription operations through this library. They might experience
INFO
logs of our library disappearing depending on their logging setup. I don't believe this a breaking change since it doesn't change any API or behaviors of the library.