diff options
author | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2010-08-24 13:24:47 +0200 |
---|---|---|
committer | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2010-08-24 13:24:47 +0200 |
commit | 9739192af1085e9f2fcf83b5e446c16801ae870a (patch) | |
tree | bdb95e40e168f5b21ad160f7fbd7a90133057688 | |
parent | e88ea135e3d93f4f1584d14090f43b2cd467c7d7 (diff) | |
download | logilab-common-9739192af1085e9f2fcf83b5e446c16801ae870a.tar.gz |
if debug is true and no threshost specified, default to DEBUG
-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 bf5447b..cfefc4c 100644 --- a/logging_ext.py +++ b/logging_ext.py @@ -125,7 +125,10 @@ def init_log(debug=False, syslog=False, logthreshold=None, logfile=None, except IOError: handler = logging.StreamHandler() if logthreshold is None: - logthreshold = logging.ERROR + if debug: + logthreshold = logging.DEBUG + else: + logthreshold = logging.ERROR elif isinstance(logthreshold, basestring): logthreshold = getattr(logging, THRESHOLD_MAP.get(logthreshold, logthreshold)) |