Write log to stderr

Be consistent with python's default behavior and play nice with CGI.
This commit is contained in:
Unrud 2016-08-25 04:29:39 +02:00
parent 14515cfe27
commit c091399f5e
2 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,7 @@ handlers = console,file
# Console handler
class = StreamHandler
level = INFO
args = (sys.stdout,)
args = (sys.stderr,)
formatter = simple
[handler_file]

View File

@ -55,9 +55,9 @@ def start(name="radicale", filename=None, debug=False):
# Default configuration, standard output
if filename:
logger.warning(
"Logging configuration file '%s' not found, using stdout." %
"Logging configuration file '%s' not found, using stderr." %
filename)
handler = logging.StreamHandler(sys.stdout)
handler = logging.StreamHandler(sys.stderr)
handler.setFormatter(logging.Formatter("%(message)s"))
logger.addHandler(handler)
if debug: