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 |
menkej
left a comment
There was a problem hiding this comment.
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. |
menkej
left a comment
There was a problem hiding this comment.
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.mainbased on the--log-leveloption, but subsequent calls tosetup_logger()resets the level toDEBUG. As a result the--log-leveloption is effectively ignored.Since the
--log-leveloption defaults toDEBUGit's safe to removelogger.setLevel()fromsetup_logger()which allows the option to work as expected.