⚗ Try to add debug level message to syslog

This commit is contained in:
Freezed 2022-10-26 01:46:40 +02:00
parent 9c6803be48
commit 0d179c4534
1 changed files with 5 additions and 7 deletions

12
main.py
View File

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