Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
New commandline option 'verbosity' to allow different log levels #3364
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 (
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?