Skip to Content [alt-c]
In reply to Comment by Anonymous
stdout is meant for the output of a program. It's where curl writes the file that it downloads. It's where a CGI webapp writes the response headers and body. It's how a server started by inetd communicates with the client. If a library logs messages to stdout, those messages will disrupt a program's output and could cause serious problems to the whoever is processing it.
Using stderr instead of stdout avoids the worst problems, but it's still usually not what you want a library to do. If the library needs to report an error, which was the case with github.com/duo-labs/webauthn, it should return it to the caller (or throw an exception, depending on the language's conventions). If a library has a legitimate need to log, then it should log to a logger provided by the user of the library, so they have control over where the messages go.
Reply
Your comment will be public. To contact me privately, email me. Please keep your comment polite, on-topic, and comprehensible. Your comment may be held for moderation before being published.
Your Name: (Optional; will be published)
Your Email Address: (Optional; will not be published)
Your Website: (Optional; will be published)
>
monospaced
Post a Reply
Your comment will be public. To contact me privately, email me. Please keep your comment polite, on-topic, and comprehensible. Your comment may be held for moderation before being published.