Logger: format the date numerically, avoid locale

When loading a translation file (and only then), the locale
is set, which affects the date formatting. Then, the logger
messages fail to be displayed on the console, because of
illegal chars.

bzr revid: p_christ@hol.gr-20090128145116-mu2jm5i264afj2vz
This commit is contained in:
P. Christeas 2009-01-28 16:51:16 +02:00
parent caa5ca5ae2
commit 876e0667e6
2 changed files with 2 additions and 2 deletions

View File

@ -92,7 +92,7 @@ def init_logger():
logger = logging.getLogger()
# create a format for log messages and dates
formatter = logging.Formatter('[%(asctime)s] %(levelname)s:%(name)s:%(message)s', '%a %b %d %Y %H:%M:%S')
formatter = logging.Formatter('[%(asctime)s] %(levelname)s:%(name)s:%(message)s', '%Y-%m-%d %H:%M:%S')
if tools.config['syslog']:
# SysLog Handler

View File

@ -606,7 +606,7 @@ def trans_load_data(db_name, fileobj, fileformat, lang, strict=False, lang_name=
})
# Here we try to reset the locale regardless.
try:
locale.setlocale(locale.LC_ALL, str(lc + '.' + encoding))
locale.resetlocale(locale.LC_ALL)
except:
pass
lang_ids = lang_obj.search(cr, uid, [])