Open MisterDA opened 2 years ago
What style looks the "sanest" to you?
I think I would go with --verbosity=LEVEL[,SRC:LEVEL]…
Did you look around if there may be existing syntax to copycat from (e.g. journalctl
or whatever) ?
What style looks the "sanest" to you?
I think I would go with
--verbosity=LEVEL[,SRC:LEVEL]…
That's quite nice!
Did you look around if there may be existing syntax to copycat from (e.g.
journalctl
or whatever) ?
journalctl doesn't seem to be able to do that. I can see that it can select multiple sources (-t
or -u
flags) but the -p
flag to select the level is global.
In my app, I have two sources of logging, Tamino and Papageno. I use logs.cli to setup the logging of my app in a similar fashion as the example. However, in debug mode, Papageno is extremely verbose and I'm much more interested by what Tamino has to say. Could it be possible to extend the API and find some way to set the verbosity of sources from the command-line interface? I can always add code to disable debug output from Papageno, but that's what I was trying to avoid by switching to logs.cli. As I understand the API, logs.cli should not set the verbosity of sources directly, but rather return the verbosity set by the user, so it might be difficult to extend the current API (
Logs_cli.level
) or come up with a new function. Regarding the actual command-line interface, I think it could look like this:What style looks the "sanest" to you? I think that only the
verbosity
flag needs the name expansion.