Changeset 298
- Timestamp:
- 26.06.2009 23:50:09 (13 months ago)
- Location:
- sordid
- Files:
-
- 2 edited
-
bot.py (modified) (3 diffs)
-
sordid.conf (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sordid/bot.py
r297 r298 71 71 'maxreply':50} 72 72 73 cp = ConfigParser. ConfigParser()73 cp = ConfigParser.RawConfigParser() 74 74 for path in config_path: 75 75 if cp.read([path]) == [path]: … … 101 101 log = cp.get('log','log').split(',') 102 102 if log[0] == 'syslog': 103 config['log'] = (logging.handlers.SysLogHandler( '/dev/log', log[1]),log[2])103 config['log'] = (logging.handlers.SysLogHandler(log[1]),getattr(logging,log[2])) 104 104 elif log[0] == 'file': 105 config['log'] = (logging.handlers.RotatingFileHandler(log[1], maxBytes=1024*1024, backupCount=3), log[2])105 config['log'] = (logging.handlers.RotatingFileHandler(log[1], maxBytes=1024*1024, backupCount=3),getattr(logging,log[2])) 106 106 else: 107 107 config['log'] = None … … 109 109 if cp.has_option('log', 'format'): 110 110 format = cp.get('log','format') 111 config['logformat'][0] = logging.Formatter(format) 111 print format 112 config['logformat'] = logging.Formatter(format) 112 113 113 114 return config -
sordid/sordid.conf
r289 r298 11 11 url=urllog.txt 12 12 subject=sublog.txt 13 # log=[file],[filename],[DEBUG|INFO|ERROR|WARN|CRITICAL] 14 # log=[syslog],[DEVICE],[DEBUG|INFO|ERROR|WARN|CRITICAL] 15 log=file,log.txt,INFO 16 #log=syslog,/dev/log,INFO 17 [foo] 13 18 maxreply=50
Note: See TracChangeset
for help on using the changeset viewer.

