-
Notifications
You must be signed in to change notification settings - Fork 573
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
Fix log-level option #194
Fix log-level option #194
Conversation
Hi @ltm ! Can you also add a test case that checks the logging handling? |
@menkej I've updated the existing |
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.
Thanks updating the test cases! I'l request one additional check: Both tests assume the logger running on INFO. There should also be a test for DEBUG level as well, what do you think?
test_until_found is an issue of its own. It behaves inconsistent (I think we have a PR for that already). I have no Idea why it sometimes runs fine and sometimes does not... |
@menkej Makes sense. I've updated (and refactored) the test to check all three log levels. |
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.
Nice work @ltm! Way better than before. Last little cream on the cake is to add this fix to the CHANGELOG.md in the unreleased section as "fix:" and then we're ready to merge! Sorry I forgot to mention this before. We just introduced the CHANGELOG recently and I'm still not used to it... ;-)
@menkej No problem. I've added a changelog entry. |
The log level is set on the logger instance in
icloudpd.base.main
based on the--log-level
option, but subsequent calls tosetup_logger()
resets the level toDEBUG
. As a result the--log-level
option is effectively ignored.Since the
--log-level
option defaults toDEBUG
it's safe to removelogger.setLevel()
fromsetup_logger()
which allows the option to work as expected.