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.
This PR simplifies the user experience for getting basic messages logged to the console when calling SlideRule APIs.
Previously
verbose
setting enabled/disabled the logging of messages received from the serverloglevel
setting changed the logging level for thesliderule
module's loggerlogging.basicConfig
This design gives the user full control - they can create individual handlers for the log messages generated in each of the submodules of the SlideRule Python client, and manage exactly how they are displayed. It also separates out the log messages coming from the server (which typically are a lot), from the log messages generated by the client (which typically are a few).
But in the vast majority of the cases, a user either wants to see messages printed to their screen, or they don't want to see anything. And the
verbose
option intuitively should control this.Changes in this PR
verbose
setting will automatically create a console logger which will display all log messages of a sufficient log level to the screenloglevel
setting will always change the global log level, and when a console logger is created (i.e. when verbose is set to True), then it will change the console logger's log level as well.verbose
to False (which is the default), and create their own log handler and attach it tosliderule.logger