Use different levels of verbosity as suggested by this comment: https://github.com/iterative/dvc/issues/2332#issuecomment-515740204
Add a TRACE level to the logging module
Change logger.debug(x) -> logger.log(TRACE, x)
perhaps creating & using logging.TRACE = 5 is better than this env var?
@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?
cmd|level
--:|:--
default|INFO
-v|DEBUG
-vv|TRACE
Ohh got it :+1: 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
https://github.com/iterative/dvc/issues/2329#issue-473668442
I like this idea better instead of using the env var
though really I'd prefer --log TRACE|DEBUG|INFO|WARN(ING)|ERROR|FATAL, and for backward compatibility -v is a shortcut for --log DEBUG
@casperdcl is this more common? I'm more used to the v's :sweat_smile:
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)
the problem with counting -v is there's no way to access WARN and ERROR. We could count -q (quiet) or similar for that.
@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?
:thinking: let's wait for the opinion of @shcheklein, @efiop , @Suor , @pared (need some quorum on this one, can't decide by myself)
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.
Awesome, @Suor , I'll add those implementation details to the description.
Most helpful comment
I am ok with counting
v/qs, this is more friendly for typing in.--logmight 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--logup our sleeves for now.