-
Notifications
You must be signed in to change notification settings - Fork 1.3k
add: output improvements #2546
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
add: output improvements #2546
Changes from all commits
9704810
f2db8d0
1909050
4aebdf7
c941c01
06b4495
6ac8935
0913ea6
f6fb05a
1c1763e
bf0a322
bdc8c70
17383ae
be7e766
ccf45ea
1bda5e2
9125ae7
628229e
7e47abd
78933a0
1fffaa8
f02951f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,11 @@ def filter(self, record): | |
| return record.levelno < logging.WARNING | ||
|
|
||
|
|
||
| class ExcludeInfoFilter(logging.Filter): | ||
| def filter(self, record): | ||
| return record.levelno < logging.INFO | ||
|
|
||
|
|
||
| class ColorFormatter(logging.Formatter): | ||
| """Enable color support when logging to a terminal that supports it. | ||
|
|
||
|
|
@@ -170,16 +175,26 @@ def setup(level=logging.INFO): | |
| logging.config.dictConfig( | ||
| { | ||
| "version": 1, | ||
| "filters": {"exclude_errors": {"()": ExcludeErrorsFilter}}, | ||
| "filters": { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you explain what is going on here in general? The commit message doesn't have any explanation.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this was needed as previously only I should've described this commit as "progress-aware |
||
| "exclude_errors": {"()": ExcludeErrorsFilter}, | ||
| "exclude_info": {"()": ExcludeInfoFilter}, | ||
| }, | ||
| "formatters": {"color": {"()": ColorFormatter}}, | ||
| "handlers": { | ||
| "console": { | ||
| "console_info": { | ||
| "class": "dvc.logger.LoggerHandler", | ||
| "level": "DEBUG", | ||
| "level": "INFO", | ||
| "formatter": "color", | ||
| "stream": "ext://sys.stdout", | ||
| "filters": ["exclude_errors"], | ||
| }, | ||
| "console_debug": { | ||
| "class": "dvc.logger.LoggerHandler", | ||
| "level": "DEBUG", | ||
| "formatter": "color", | ||
| "stream": "ext://sys.stdout", | ||
| "filters": ["exclude_info"], | ||
| }, | ||
| "console_errors": { | ||
| "class": "dvc.logger.LoggerHandler", | ||
| "level": "WARNING", | ||
|
|
@@ -190,15 +205,27 @@ def setup(level=logging.INFO): | |
| "loggers": { | ||
| "dvc": { | ||
| "level": level, | ||
| "handlers": ["console", "console_errors"], | ||
| "handlers": [ | ||
| "console_info", | ||
| "console_debug", | ||
| "console_errors", | ||
| ], | ||
| }, | ||
| "paramiko": { | ||
| "level": logging.CRITICAL, | ||
| "handlers": ["console", "console_errors"], | ||
| "handlers": [ | ||
| "console_info", | ||
| "console_debug", | ||
| "console_errors", | ||
| ], | ||
| }, | ||
| "flufl.lock": { | ||
| "level": logging.CRITICAL, | ||
| "handlers": ["console", "console_errors"], | ||
| "handlers": [ | ||
| "console_info", | ||
| "console_debug", | ||
| "console_errors", | ||
| ], | ||
| }, | ||
| }, | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -663,7 +663,7 @@ def dump(self): | |
|
|
||
| self._check_dvc_filename(fname) | ||
|
|
||
| logger.info( | ||
| logger.debug( | ||
| "Saving information to '{file}'.".format(file=relpath(fname)) | ||
|
Comment on lines
666
to
667
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And one last question: Is this really a debug output? I also find that message useful in the output.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the thing is the tracked file name will be printed in the progress bar itself, while the dvc file names will all be printed at the end. This means this message should no longer be required. I left it in for 1. debugging and 2. not sure if the 12 other uses of
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool. Feel fee to ask @efiop and/or resolve this conversation when you see fit. Thanks. |
||
| ) | ||
| d = self.dumpd() | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.