http://www.mediawiki.org/wiki/Special:Code/pywikipedia/10900
Revision: 10900 Author: drtrigon Date: 2013-01-13 11:04:58 +0000 (Sun, 13 Jan 2013) Log Message: ----------- need a default log handler, default logging level is INFO
Modified Paths: -------------- trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py =================================================================== --- trunk/pywikipedia/wikipedia.py 2013-01-12 23:27:08 UTC (rev 10899) +++ trunk/pywikipedia/wikipedia.py 2013-01-13 11:04:58 UTC (rev 10900) @@ -8705,7 +8705,12 @@ return logger.setLevel(logging.DEBUG) # create file handler which logs even debug messages - if config.loghandler.upper() == 'TRFH': + if config.loghandler.upper() == 'RFH': + fh = logging.handlers.RotatingFileHandler(filename=logfn, + maxBytes=1024 * config.logfilesize, + backupCount=config.logfilecount, + encoding='utf-8') + else: fh = logging.handlers.TimedRotatingFileHandler(logfn, when='midnight', utc=False, @@ -8718,13 +8723,7 @@ if os.path.exists(logfn): t = os.stat(logfn).st_mtime fh.rolloverAt = fh.computeRollover(t) - elif config.loghandler.upper() == 'RFH': - fh = logging.handlers.RotatingFileHandler(filename=logfn, - maxBytes=1024 * config.logfilesize, - backupCount=config.logfilecount, - encoding='utf-8') - #fh.setLevel(logging.DEBUG if debug else logging.INFO) - fh.setLevel(logging.DEBUG) + fh.setLevel(logging.DEBUG if debug else logging.INFO) # create console handler with a higher log level ch = logging.StreamHandler() ch.setLevel(logging.INFO)
pywikipedia-svn@lists.wikimedia.org