Skip to content
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

Merged
merged 1 commit into from
Jul 30, 2020
Merged

dvc: fix --quiet mode #4304

merged 1 commit into from
Jul 30, 2020

Conversation

efiop
Copy link
Contributor

@efiop efiop commented Jul 30, 2020

Part of the issue is a bug from #3806

Kudos to @karajan1001 for finding this bug while working on #4282

Thank you for the contribution - we'll try to review it as soon as possible. πŸ™

@efiop efiop changed the title Fix quiet dvc: fix --quiet mode Jul 30, 2020
@@ -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()
Copy link
Contributor Author

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
Comment on lines 40 to 50
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)

Copy link
Contributor Author

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 πŸ™‚

@efiop efiop added the p1-important Important, aka current backlog of things to do label Jul 30, 2020
@efiop efiop self-assigned this Jul 30, 2020
Part of the issue is a bug from iterative#3806

Kudos to @karajan1001 for finding this bug while working on iterative#4282
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p1-important Important, aka current backlog of things to do
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant