MantisBT - Doomseeker
View Issue Details
0003372Doomseeker[All Projects] Bugpublic2018-02-15 02:052018-10-27 22:55
Zalewa 
Zalewa 
normalminoralways
closedfixed 
1.1 
1.21.2 
0003372: Diagnostics messages are written to stdout (instead of stderr)
Doomseeker's startup logs (etc) are like diagnostics messages, but treated as normal output from the program. This goes against POSIX' description of stderr:

Quote
At program start-up, three streams shall be predefined: [...] standard output (for writing conventional output), and standard error (for writing diagnostic output).


stdout makes sense for --version-json as conventional JSON output, but the diagnostics messages should really be changed from stdout to stderr.
On Unix-like machines:

doomseeker 1>/tmp/stdout.log 2>/tmp/stderr.log


See /tmp/stdout.log and /tmp/stderr.log for messages of the appropriate standard stream.

  • http://pubs.opengroup.org/onlinepubs/9699919799/functions/stderr.html

  • https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html

  • https://unix.stackexchange.com/q/331611/

No tags attached.
related to 0003282closed Zalewa Omitting file from --version-json command line parameter doesn't print to standard output 
Issue History
2018-02-15 02:05WubTheCaptainNew Issue
2018-02-15 02:05WubTheCaptainStatusnew => assigned
2018-02-15 02:05WubTheCaptainAssigned To => Zalewa
2018-02-15 02:06WubTheCaptainRelationship addedrelated to 0003282
2018-02-15 02:06WubTheCaptainReporterWubTheCaptain => Zalewa
2018-02-15 02:06WubTheCaptainStatusassigned => resolved
2018-02-15 02:06WubTheCaptainResolutionopen => fixed
2018-02-15 02:06WubTheCaptainFixed in Version => 1.2
2018-02-15 02:08WubTheCaptainNote Added: 0019042
2018-02-15 02:21WubTheCaptainNote Added: 0019043
2018-02-15 02:21WubTheCaptainStatusresolved => feedback
2018-02-15 02:21WubTheCaptainResolutionfixed => reopened
2018-02-15 02:23WubTheCaptainSummaryLogs are written to stdout instead of stderr => Diagnostics logs are written to stdout (instead of stderr)
2018-02-15 02:27WubTheCaptainSummaryDiagnostics logs are written to stdout (instead of stderr) => Diagnostics messages are written to stdout (instead of stderr)
2018-02-15 02:30WubTheCaptainNote Added: 0019044
2018-02-15 03:20WubTheCaptainNote Edited: 0019043bug_revision_view_page.php?bugnote_id=19043#r11395
2018-02-15 07:37ZalewaNote Added: 0019050
2018-02-15 07:37ZalewaStatusfeedback => assigned
2018-02-15 08:41ZalewaNote Added: 0019051
2018-02-15 08:41ZalewaStatusassigned => needs testing
2018-09-25 03:11WubTheCaptainNote Added: 0019748
2018-09-25 03:11WubTheCaptainStatusneeds testing => resolved
2018-09-25 03:11WubTheCaptainResolutionreopened => fixed
2018-09-25 03:12WubTheCaptainNote Edited: 0019748bug_revision_view_page.php?bugnote_id=19748#r11997
2018-10-27 22:55WubTheCaptainStatusresolved => closed

Notes
(0019042)
WubTheCaptain   
2018-02-15 02:08   
This was fixed:'https://bitbucket.org/Doomseeker/doomseeker/commits/87122ce09493fbad5fe718acf64ef2950167fd13 [^]'

I thought of submitting a bug for the bug tracker for future reference, anyway.
(0019043)
WubTheCaptain   
2018-02-15 02:21   
(edited on: 2018-02-15 03:20)
Interestingly enough, I would like to reopen this issue for more discussion.

One of the answers in the linked Unix & Linux Stack Exchange thread argues whether POSIX-like programs should be quiet by default (that's an Unix-y thing to do), and only output to stderr if the exit status was non-zero. To quote:

Quote from POSIX.1-2008, 1.4 Utility Description Defaults
Default Behavior: When this section is listed as "The standard error shall be used only for diagnostic messages.", it means that, unless otherwise stated, the diagnostic messages shall be sent to the standard error only when the exit status indicates that an error occurred and the utility is used as described by this volume of POSIX.1-2008.


Do we need to introduce a command line flag for --quiet or --verbose? I'd keep them to stderr, though.

(0019044)
WubTheCaptain   
2018-02-15 02:30   
Quote from WubTheCaptain
I'd keep them to stderr, though.


Haha disregard that, stdout probably makes more sense with a --verbose (or -v) flag with quiet by default behavior. Anyone agree?

stderr for real diagnostics errors, though.
(0019050)
Zalewa   
2018-02-15 07:37   
--version-json could indeed benefit from not being spammed with stderr logs by default
(0019051)
Zalewa   
2018-02-15 08:41   
"--quiet" and "--verbose" added here:'https://bitbucket.org/Doomseeker/doomseeker/commits/53e2af801b780f3d233bd8a24ea558535d887efd [^]'
(0019748)
WubTheCaptain   
2018-09-25 03:11   
(edited on: 2018-09-25 03:12)
As said, this has been resolved.

Side-note: It seems like --verbose is useless at this point and --quiet works as intended. The output isn't quiet by default (except on stdout), but uh, we don't do much with stdout anyway. It's not like Doomseeker had stdout of its server lists in some specific format for other applications to use.