diff options
author | root <root@krebs> | 2011-09-14 20:36:40 +0200 |
---|---|---|
committer | root <root@krebs> | 2011-09-14 20:36:40 +0200 |
commit | bac8559a60a831f740ff4107f1c29bf679fd27b5 (patch) | |
tree | 318d1b977b6457a780c6ccd829a2b18b269e44de | |
parent | 2be61d87ebdcef051d4080636944d576e7083fcf (diff) |
Reaktor/asybot: add syslog logging feature
-rwxr-xr-x | IRC/asybot.py | 8 |
1 files changed, 6 insertions, 2 deletions
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): |