Closed robweber closed 3 years ago
I thought the log level flag only effected the info written to the logfile, and that the console always gets everything.
That's exactly what it does. https://github.com/TomWhitwell/SlowMovie/blob/df9c4b1a45894c1a3d55c01df08f986ec71f9c71/slowmovie.py#L204 https://github.com/TomWhitwell/SlowMovie/blob/df9c4b1a45894c1a3d55c01df08f986ec71f9c71/slowmovie.py#L209 Would it be better to have another argument for the console level?
I feel like since most of the time the program won't be running from the console, it's fine to have all output go to the console in that case, and be able to chose what goes to the logs in all other cases. Maybe this isn't too clear in the documentation, though...
help="minimum importance-level of messages saved to the logfile (default: %(default)s)")
Maybe adding "(all messages go to the console)" or something like that here.
The message does say "saved to the logfile". Seems okay to me, but maybe something like that could help.
Agreed. Let's see what rob thinks
Perhaps the wording is enough. Just anecdotally I don't think I've ever seen a program where setting the log level affects one part of the program but not another - or where DEBUG is the default. Certainly threw me off guard when I thought "I'll just turn the debug messages off" and couldn't.
Do you think making the console and log output always match up would be better?
I'd be willing to change it so that console output and logging always match up. That's certainly easier to understand from a user perspective. The only downside I see is if you want to look at the console for debug info for a bit, you'll add a bit of fluff to the log for however long you're looking at the console.
That sounds fine, let's just do that. The levels could be added to the logfile so it can be grep'd.
Edit: done.
Describe the problem Running
slowmovie.py
with different log levels doesn't seem to produce any different results in the console log. By default it appears to be DEBUG level (says INFO in help menu) but trying to change it to other levels always has the same output.Steps to Reproduce
python slowmovie.py -o INFO
Watch the console output. Logging that should be debug is output. Linked to an example line.
Similarly using
-o CRITICAL
both debug and info lines are still output.Platform Information N/A