-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New commandline option 'verbosity' to allow different log levels #3364
Conversation
…levels of logging. Currently, levels 0 (none), 1 (info) and 2 (extra) are supported. Current 'quiet' option has been kept for backwards compatibility and it has been mapped to the new 'verbosity' values 0 (--quiet=true) and 1 (--quiet=false).
Looks good to me, but I think the description is incorrect. It should be
Also, making the default verbosity to 1 is a behavioral change, as it was previously 2. I think it'd be better to use an enum Verbosity with 3 values: Silent, Errors, WarningsAndErrors. Then, introduce a new command-line flag ( |
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.
see above.
I'd turn verbosity INTs into level names (--loglevel), if you think it's more appropriate: e.g., 0 would become 'silent', 1 -> 'error', 2 -> 'warn', 3 -> 'info' (which are ready to add more levels, like 'debug', if needed someday). As cumulative levels, 'warn' would include 'error' as well as 'info' would include 'warn' and 'error'. To keep behavior unchanged, the default '--loglevel' would be 'info' and the effect of using '--quiet' would be to set '--loglevel' to 'silent' (or 'none', as it's shorter, if it is Ok to you). The bindings would be enhanced with a new callback for leveled logging while keeping backwards compatibility. I don't see the command-line flag '--silent' in the final picture, since both '--quiet' and '--loglevel silent' lead to the same behavior. If using '--quiet' and '--loglevel' other than 'silent': the last value wins. Is this all Ok? |
I'd prefer |
Thanks for the contribution! |
Thanks to you! Keep up the good work! |
A release candidate is available which includes the fixes made in this PR -- please test and report your findings before the final release. |
Verbosity levels 0 (none), 1 (info) and 2 (extra) are supported. Current option 'quiet' is kept for backwards compatibility. It has been mapped to the new 'verbosity' values 0 (--quiet=true) and 1 (--quiet=false).