-
Notifications
You must be signed in to change notification settings - Fork 74
Follow advised logging practices #229
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
Merged
Merged
Conversation
This file contains hidden or 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
0e3d76d to
a9fd5a4
Compare
Contrary to what https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library advises, we were defining our own StreamHandler with custom formatter and filter. It is strongly advised for libraries to not do that. We are following that advice now. In short, the changes done are described below. - Use module-level loggers with the module name as the logger name. It is described as a good convention in the https://docs.python.org/3/howto/logging.html#advanced-logging-tutorial. - Do not add a Handler with custom formatter and filter by default. - Do not print the latest commit id in the Lifecycle service as it requires reading a file during the client startup. Instead, the client version is printed. To make test failure reports easier to follow, the latest commit id is printed for the test logs. - For tests, a single configuration is added to the root logger in the init file. That way, all tests will reuse that. - Do not pass logger extras anymore as they don't make sense without a custom formatter or filter. We may provide utility implementations for a formatter and a filter and pass extras even if they won't be used most of the time. I chose not to pass them, but that can be discussed. - Remove `logging_level` and `logging_config` confiugration options. - Update README.
puzpuzpuz
approved these changes
Nov 5, 2020
puzpuzpuz
left a comment
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.
Looks like a good improvement 👍
mdumandag
added a commit
to mdumandag/hazelcast-python-client
that referenced
this pull request
Nov 18, 2020
Documentation about logging_config and logging_level were not removed in hazelcast#229. This removes them, since they are not usable anymore.
mdumandag
added a commit
to mdumandag/hazelcast-python-client
that referenced
this pull request
Nov 19, 2020
Documentation about logging_config and logging_level were not removed in hazelcast#229. This removes them, since they are not usable anymore.
mdumandag
added a commit
that referenced
this pull request
Nov 19, 2020
Documentation about logging_config and logging_level were not removed in #229. This removes them, since they are not usable anymore.
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.
Contrary to what https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library
advises, we were defining our own StreamHandler with custom formatter and
filter. It is strongly advised for libraries to not do that. We are following that
advice now. In short, the changes done are described below.
as a good convention in the https://docs.python.org/3/howto/logging.html#advanced-logging-tutorial.
during the client startup. Instead, the client version is printed. To make test failure
reports easier to follow, the latest commit id is printed for the test logs.
That way, all tests will reuse that.
filter. We may provide utility implementations for a formatter and a filter and pass
extras even if they won't be used most of the time. I chose not to pass them, but that
can be discussed.
logging_levelandlogging_configconfiugration options.