3 ms·
Who says output to stderr means an error has occurred? Or if there's a special file number for logs, why not then five special handles per log level? And that
by sk5t 5y ago
Who says output to stderr means an error has occurred? Or if there's a special file number for logs, why not then five special handles per log level? And that's how you get Windows and WMI.
- AtlasBarfed 5y agoI see your point, but really to me stderr should see.... errors. So a logging level of TRACE/DEBUG/INFO/WARN/ERROR/FATAL, WARN/ERROR/FATAL should probably go to stderr. "stdlog" should get all the levels of logging/verbosity. And should every program you run put logging into /var/log? I get if you have daemons, servers, OS tasks, etc. But what about the mass of commands and programs that are more adhoc? I don't want /var/log polluting with 10 variants of top, text editors, grep variants, find utils, etc. If there's an error or a logging trace I want to follow for those, I just want to inspect...the stream ... a nice STANDARD stream name/number. As a real world example of stderr meaning error, the godforsaken AWS api puts tons of error codes in stderr. If you are trying to automate around that (for, say, auth expiration and re-auth), you need to parse that crap sometimes.