Changeset 298


Ignore:
Timestamp:
26.06.2009 23:50:09 (13 months ago)
Author:
shiml
Message:

sordid: bug-o-maniac

Location:
sordid
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sordid/bot.py

    r297 r298  
    7171                'maxreply':50} 
    7272   
    73     cp = ConfigParser.ConfigParser() 
     73    cp = ConfigParser.RawConfigParser() 
    7474    for path in config_path: 
    7575        if cp.read([path]) == [path]: 
     
    101101        log = cp.get('log','log').split(',') 
    102102        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])) 
    104104        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])) 
    106106        else: 
    107107            config['log'] = None 
     
    109109    if cp.has_option('log', 'format'): 
    110110        format = cp.get('log','format') 
    111         config['logformat'][0] = logging.Formatter(format) 
     111        print format 
     112        config['logformat'] = logging.Formatter(format) 
    112113 
    113114    return config 
  • sordid/sordid.conf

    r289 r298  
    1111url=urllog.txt 
    1212subject=sublog.txt 
     13# log=[file],[filename],[DEBUG|INFO|ERROR|WARN|CRITICAL] 
     14# log=[syslog],[DEVICE],[DEBUG|INFO|ERROR|WARN|CRITICAL] 
     15log=file,log.txt,INFO 
     16#log=syslog,/dev/log,INFO 
     17[foo] 
    1318maxreply=50 
Note: See TracChangeset for help on using the changeset viewer.