Additional address for sysloghandler to handle mac

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Chris Coutinho 2019-10-12 11:32:55 +02:00 committed by Nicolas Sebrecht
parent 4208fd4a15
commit 403ddf9c1c
1 changed files with 6 additions and 1 deletions

View File

@ -96,8 +96,13 @@ class UIBase(object):
def setup_sysloghandler(self):
"""Backend specific syslog handler."""
if sys.platform == 'darwin':
address = '/var/run/syslog'
else:
address = '/dev/log'
# create syslog handler
ch = logging.handlers.SysLogHandler('/dev/log')
ch = logging.handlers.SysLogHandler(address)
# create formatter and add it to the handlers
self.formatter = logging.Formatter("%(message)s")
ch.setFormatter(self.formatter)