Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
0d179c4534 |
12
main.py
12
main.py
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user