Move root logger config to CLI module#28
Merged
Conversation
avaldebe
reviewed
Nov 18, 2021
Previously we configured the root logger in the PMS package itself, which would mean any code using the package as a library would get the logging config as a side effect. Rather than configure the root logger, which should be left to the toplevel program, this re-scopes how we set the config to apply to just the specific logger for the package.
This follows the convention for typer prorams. Note the same can
also be achieved with e.g.
python -c 'from pms.cli import main; main()'
but having it run automatically saves documenting this.
avaldebe
approved these changes
Nov 19, 2021
Owner
|
1e6 thanks for your contributtion |
Contributor
Author
|
@avaldebe thanks for the speedy review! Could you release the new version to PyPI? |
Owner
|
done |
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
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.
Fixes: #27.
This ensures the root logger is only configured when
this package is used as a command.
I've also added an extra commit to support local dev -
happy to learn if there's a way of doing it already.