diff options
author | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2010-09-23 14:26:00 +0200 |
---|---|---|
committer | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2010-09-23 14:26:00 +0200 |
commit | a4d541d67062fe234be812c7ee83a8f48440916b (patch) | |
tree | 7b35fb9ccfae87f3a5d3d478dbb10332408aeb04 /logging_ext.py | |
parent | 82225530aca4fbfe5520e759d6ccc8adc75c3d52 (diff) | |
download | logilab-common-a4d541d67062fe234be812c7ee83a8f48440916b.tar.gz |
[logging]?dont attempt to use color formatter unless asked for debug mode
Diffstat (limited to 'logging_ext.py')
-rw-r--r-- | logging_ext.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/logging_ext.py b/logging_ext.py index e87aace..0eba371 100644 --- a/logging_ext.py +++ b/logging_ext.py @@ -159,7 +159,10 @@ def init_log(debug=False, syslog=False, logthreshold=None, logfile=None, logthreshold = get_threshold(debug, logthreshold) logger.setLevel(logthreshold) if fmt is None: - fmt = get_formatter(logformat=LOG_FORMAT, logdateformat=LOG_DATE_FORMAT) + if debug: + fmt = get_formatter(logformat=logformat, logdateformat=logdateformat) + else: + fmt = logging.Formatter(logformat, logdateformat) handler.setFormatter(fmt) return handler |