From bac8559a60a831f740ff4107f1c29bf679fd27b5 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 14 Sep 2011 20:36:40 +0200 Subject: Reaktor/asybot: add syslog logging feature --- IRC/asybot.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'IRC') diff --git a/IRC/asybot.py b/IRC/asybot.py index 9021d22..99cb2fe 100755 --- a/IRC/asybot.py +++ b/IRC/asybot.py @@ -15,8 +15,12 @@ from datetime import datetime as date, timedelta from sys import exit from re import split, search -import logging -log = logging.getLogger() +import logging,logging.handlers +log = logging.getLogger('asybot') +hdlr = logging.handlers.SysLogHandler(facility=logging.handlers.SysLogHandler.LOG_DAEMON) +formatter = logging.Formatter( '%(filename)s: %(levelname)s: %(message)s') +hdlr.setFormatter(formatter) +log.addHandler(hdlr) class asybot(asychat): def __init__(self, server, port, nickname, targets, **kwargs): -- cgit v1.2.3