⚗ Try to add debug level message to syslog
This commit is contained in:
parent
9c6803be48
commit
0d179c4534
12
main.py
12
main.py
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user