modifié: m/log.py

This commit is contained in:
sidya82 2014-03-03 13:23:52 +01:00
parent df6df07ac0
commit 36693ed415

View File

@ -5,10 +5,13 @@ from datetime import datetime
class Log(object): class Log(object):
def __init__(self) : def __init__(self) :
self.logger = logging.getLogger() log = logging()
self.logger.addLevelName(25, SUCCESS) log.addLevelName(25, SUCCESS)
self.logger = log.getLogger()
self.logger.setLevel(logging.DEBUG) self.logger.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)-15s :: %(levelname)s :: %(message)s') formatter = logging.Formatter('%(asctime)-15s :: %(levelname)s :: %(message)s')
file_handler = RotatingFileHandler('activity.log', 'a', 1000000, 1) file_handler = RotatingFileHandler('activity.log', 'a', 1000000, 1)
file_handler.setLevel(logging.DEBUG) file_handler.setLevel(logging.DEBUG)
file_handler.setFormatter(formatter) file_handler.setFormatter(formatter)