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

logger: disable state logging by default #2332

Closed
ghost opened this issue Jul 27, 2019 · 10 comments · Fixed by #3806
Closed

logger: disable state logging by default #2332

ghost opened this issue Jul 27, 2019 · 10 comments · Fixed by #3806
Assignees
Labels
enhancement Enhances DVC ui user interface / interaction

Comments

@ghost
Copy link

ghost commented Jul 27, 2019

Related: #2329

@ghost ghost added enhancement Enhances DVC ui user interface / interaction labels Jul 27, 2019
@casperdcl
Copy link
Contributor

perhaps creating & using logging.TRACE = 5 is better than this env var?

@ghost
Copy link
Author

ghost commented Jul 28, 2019

@casperdcl could you explain a little bit more? I'm not sure where the user should set the logging.TRACE = 5 is it through the config file?

@casperdcl
Copy link
Contributor

cmd level
default INFO
-v DEBUG
-vv TRACE

@ghost
Copy link
Author

ghost commented Jul 28, 2019

Ohh got it 👍 yep, that's what I purposed first on the linked issue:

My suggestion would be to create different verbose levels, -vvv (INFO, DEBUG, DATABASE?)
...
Modify the -v so you can express the level of verbosity with several ones -vvv
#2329 (comment)

I like this idea better instead of using the env var

@casperdcl
Copy link
Contributor

though really I'd prefer --log TRACE|DEBUG|INFO|WARN(ING)|ERROR|FATAL, and for backward compatibility -v is a shortcut for --log DEBUG

@ghost
Copy link
Author

ghost commented Jul 28, 2019

@casperdcl is this more common? I'm more used to the v's 😅

Even the argparse documentation has a section on it:

>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('--verbose', '-v', action='count')
>>> parser.parse_args(['-vvv'])
Namespace(verbose=3)

@casperdcl
Copy link
Contributor

the problem with counting -v is there's no way to access WARN and ERROR. We could count -q (quiet) or similar for that.

@ghost
Copy link
Author

ghost commented Jul 28, 2019

@casperdcl so, it would start on INFO by deafult, if you want just warnings then use one -q, if you want to silence everything -qq, and one -v will be for DEBUG and two for TRACE, right?

🤔 let's wait for the opinion of @shcheklein, @efiop , @Suor , @pared (need some quorum on this one, can't decide by myself)

@Suor
Copy link
Contributor

Suor commented Jul 29, 2019

I am ok with counting v/qs, this is more friendly for typing in. --log might be useful for scripting - more obvious when you read it, not sure how much common scripting dvc is though.

So my preference: implement v/qs, and keep --log up our sleeves for now.

@ghost
Copy link
Author

ghost commented Jul 30, 2019

Awesome, @Suor , I'll add those implementation details to the description.

@casperdcl casperdcl self-assigned this Sep 28, 2019
casperdcl added a commit to casperdcl/dvc that referenced this issue May 15, 2020
efiop pushed a commit that referenced this issue May 20, 2020
* logger: initial verbosity/quiet counts

Fixes #2332

* actually use TRACE

* logger: properly patch in trace

* FATAL -> CRITICAL

* only change log level if not info

Makes testing easier

* tests: logger: fix and update

* state: logger: debug => trace

* logger: filter duplicate debug messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhances DVC ui user interface / interaction
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants