First, I really like the idea behind loguru.
Why is the default logger logging to stderr? and not stdout? Can you add a paragraph explaining this choice?
Hello @oz123.
Actually, I made this choice without thinking too much about this, mainly because logging to stderr rather than stdout seems to be a widely accepted convention.
For example, logging.basicConfig() and logging.StreamHandler defaults to stderr. Also, the POSIX standard specifies that stderr is the correct stream for "diagnostic output".
The main compelling case in favor or logging to stderr in my opinion is that is avoid mixing the actual output of your application with debug information of your logs. Consider for example pipe-redirection like python my_app.py | other_app which would not be possible if logs were emitted to stdout.
@Delgan, thanks for taking the time to answer this question. I really appreciate it. This detailed answer is really helpful.
Sure, no problem. 馃憤
I will add some words about this choice in the documentation.
I added a paragraph near the top of the documentation, explaining rational behind this choice. :)
Most helpful comment
Hello @oz123.
Actually, I made this choice without thinking too much about this, mainly because logging to
stderrrather thanstdoutseems to be a widely accepted convention.For example,
logging.basicConfig()andlogging.StreamHandlerdefaults tostderr. Also, the POSIX standard specifies thatstderris the correct stream for "diagnostic output".The main compelling case in favor or logging to
stderrin my opinion is that is avoid mixing the actual output of your application with debug information of your logs. Consider for example pipe-redirection likepython my_app.py | other_appwhich would not be possible if logs were emitted tostdout.