-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
dvc: fix --quiet mode #4304
dvc: fix --quiet mode #4304
Conversation
@@ -92,11 +101,3 @@ def main(argv=None): | |||
# Remove cached repos in the end of the call, these are anonymous | |||
# so won't be reused by any other subsequent run anyway. | |||
clean_repos() |
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.
Ideally these should be put into atexit kinda like https://github.com/python/cpython/blob/e1945307d36849f8be8937144cf3dd6ebab6274c/Lib/multiprocessing/util.py#L362 . Since they are not only relevant for CLI but for API as well. This also might be the reason why we are getting some weird fini errors in tests.
dvc/main.py
Outdated
verbosity = args.verbose - args.quiet | ||
if verbosity: | ||
logger.setLevel( | ||
{ | ||
-2: logging.CRITICAL, | ||
-1: logging.ERROR, | ||
1: logging.DEBUG, | ||
2: logging.TRACE, | ||
}[max(-2, min(verbosity, 2))] | ||
) | ||
level = None | ||
if args.quiet: | ||
level = logging.CRITICAL | ||
elif args.verbose: | ||
trace = args.verbose > 1 | ||
level = logging.TRACE if trace else logging.DEBUG | ||
|
||
if level is not None: | ||
logger.setLevel(level) | ||
|
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.
Got a bit too fancy with the magic π
Part of the issue is a bug from iterative#3806 Kudos to @karajan1001 for finding this bug while working on iterative#4282
Part of the issue is a bug from #3806
Kudos to @karajan1001 for finding this bug while working on #4282
β I have followed the Contributing to DVC checklist.
π If this PR requires documentation updates, I have created a separate PR (or issue, at least) in dvc.org and linked it here.
Thank you for the contribution - we'll try to review it as soon as possible. π