Add option --log-cli-level in python-pytest-dispatch#74
Merged
Conversation
wbolster
approved these changes
Aug 10, 2024
Owner
|
lgtm, thanks 🚀 |
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.
When writing tests, I usually display debugging information by using
logging.info(...)orlogging.debug(...). When--log-cli-level=debugis passed topytest,logging.infoandlogging.debugmessages are shown. When--log-cli-level=infois passed topytest,logging.infomessages are shown. In this pull request, I introduce changes to include--log-cli-levelinpython-pytest-dispatchso that users can conveniently toggle this option.I wanted to use
-las the shortcut for setting--log-cli-level, but-lis already used inpython-pytest-dispatchfor setting--showlocals. For this reason, I ended up using--l.It is worth mentioning that pytest not only defines
--log-cli-level, but it also defines--log-level,--log-file-level. However, I don't know what--log-leveland--log-file-levelare used for. I have only used--log-cli-levelbecause suits my use case