UIBase: add a syslog ui

Rather than having an option for syslog output, make a separate UI
option.

Signed-off-by: Ben Boeckel <mathstuf@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Ben Boeckel
2015-10-12 13:35:57 -04:00
committed by Nicolas Sebrecht
parent 3daddb9b33
commit e18428b25b
8 changed files with 39 additions and 7 deletions

View File

@ -16,6 +16,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import logging
import logging.handlers
import re
import time
import sys
@ -94,9 +95,8 @@ class UIBase(object):
def setup_sysloghandler(self):
"""Backend specific syslog handler."""
# create console handler with a higher log level
ch = logging.SysLogHandler(sys.stdout)
#ch.setLevel(logging.DEBUG)
# create syslog handler
ch = logging.handlers.SysLogHandler('/dev/log')
# create formatter and add it to the handlers
self.formatter = logging.Formatter("%(message)s")
ch.setFormatter(self.formatter)