Compare commits

...

1 Commits

Author SHA1 Message Date
Freezed
0d179c4534 ⚗ Try to add debug level message to syslog 2022-10-26 01:46:40 +02:00

12
main.py
View File

@ -33,17 +33,15 @@ def setup_logging(options):
if not sys.stderr.isatty(): if not sys.stderr.isatty():
# Logging in a file when launched not in a terminal # Logging in a file when launched not in a terminal
root.addHandler(
facility = logging.handlers.SysLogHandler.LOG_DAEMON logging.handlers.SysLogHandler(
handler_syslog = logging.handlers.SysLogHandler( address="/dev/log",
address="/dev/log", facility=facility facility=logging.handlers.SysLogHandler.LOG_DAEMON,
)
) )
handler_syslog.setFormatter(logging.Formatter(format_default))
root.addHandler(handler_syslog)
else: else:
# Logging on terminal standard output # Logging on terminal standard output
handler_console = logging.StreamHandler() handler_console = logging.StreamHandler()
handler_console.setFormatter(logging.Formatter(format_debug)) handler_console.setFormatter(logging.Formatter(format_debug))
root.addHandler(handler_console) root.addHandler(handler_console)