Menu

Logging output using StandardOutput and StandardError streams

It turns out programs output some things to StandardOutput, and other things to StandardError. So the StandardError stream may contain verbose output as well as errors. To display errors properly, I now search the StandardError stream for the word "error", and then display the entire line containing that word. Yes, it's an ugly hack, and it's not perfect, but "error" is fairly universal word for all error messages, so at least I'll print those messages. I also created another flag "Verbose" which will display the entire StandardError stream, which will include detailed output from some external programs. Yes another hack, but it works.

Posted by Christopher J Cantwell 2023-03-09

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.