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:
+1
-1
@@ -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
|
||||
|
||||
@@ -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, [])
|
||||
|
||||
Reference in New Issue
Block a user