-
-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
daemons lack a -q (quiet flag) #1789
Comments
Does make sense (per that discussion), although a mixed As mentioned in that discussion, on the technical side there is a complication that NUT programs print the banner before handling the CLI arguments and config files (which can set the debug levels), and might abort during that (e.g. because of unknown args). With the banner always being before further messages, understanding who complained and why is easier. Either programs would have to be adjusted to print the banner whenever they abort during CLI/config processing (register some |
I vote for using -v for verbose and making -q default, which avoids the quiet/debug fighting. As for #1667, I hope ssl was only initialized if the user asked to do something ssl-ish. |
Also, about banner: It is very rare for daemons to print version to stdout/stderr. The standard approach is to daemoize and log a "foo started" at LOG_INFO. That might as well have the version. Certainly if there's a problem that prevents daemonizing, that's fair on stderr Another common pattern is to have --version or -V to print the version (and do nothing else). With that, there's no need to print the version if the arguments are invalid, so the whole "when to print the banner" becomes moot. |
…h debug enabled Related-to: networkupstools#1789
…led()` common method [balancing issues networkupstools#1789 vs. networkupstools#316] Signed-off-by: Jim Klimov <[email protected]>
… checking [networkupstools#1789 vs. networkupstools#316] Signed-off-by: Jim Klimov <[email protected]>
…e banner_is_disabled() checking [networkupstools#1789 vs. networkupstools#316] Signed-off-by: Jim Klimov <[email protected]>
In PR #2568 among other things I'm trying a balanced envvar-based approach (so easy to stick into wrapper scripts, shell profile, Several other programs only print it with the Troubleshooting-wise, I rule in favor of having it available by default, since it already takes days of turnaround in issue discussions to pull such details as "which NUT version are you complaining about?" with many users. Some have little way to know that without a lot of spelunking -- using embedded builds, HA plugin containers, etc. Having the string in their screenshots or log excerpts helps a lot. But deployments run by power-users who are annoyed by these banners can now be made quieter with a single line in their NUT configs or shell profiles. @gdt: WDYT, can the issue be deemed resolved by this approach? :) |
You are the BDFL, so it's your call. But I think programs should not print these by default, and that's what -V or --version is for (and fine for it to be in the on-error usage output). The fact that users submit terrible bug reports is not a good reason to burden others with noise or ask them to do something which I view as kludgy. |
Preferences differ, but now there is no approach for people that think daemons should print (stdout/stderr) only things that are noteworthy (critical or an error) or specifically requested. This is a feature request to add -q to drivers/upsd/upsmon/upslog so that it is quiet absent critical/error/requested.
For a longer discussion, see #1782.
The text was updated successfully, but these errors were encountered: