Fix logging formatter of logfile for issue1457

This commit is contained in:
Cédric Krier committed 2010-03-26 19:01:26 +01:00
1 parent fd6db3adae
commit d80ac90dda
1 file changed
+5 -4
+5 -4
View File
@@ -22,9 +22,10 @@ import random
class TrytonServer(object):
def __init__(self):
logging.basicConfig(level=logging.DEBUG,
format='[%(asctime)s] %(levelname)s:%(name)s:%(message)s',
datefmt='%a %b %d %H:%M:%S %Y')
format = '[%(asctime)s] %(levelname)s:%(name)s:%(message)s'
datefmt = '%a %b %d %H:%M:%S %Y'
logging.basicConfig(level=logging.DEBUG, format=format,
datefmt=datefmt)
CONFIG.parse()
@@ -43,7 +44,7 @@ class TrytonServer(object):
"ERROR: couldn't create the logfile directory:" \
+ str(exception))
else:
formatter = logging.Formatter(FORMAT, DATEFMT)
formatter = logging.Formatter(format, datefmt)
# tell the handler to use this format
handler.setFormatter(formatter)