summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2010-02-02 16:58:17 -0500
committerRob Crittenden <rcritten@redhat.com>2010-02-03 11:52:15 -0500
commitf43f6c50c6d6c0f456ef30a9887dd6649ac9b879 (patch)
tree73358ab44c429503376e8c18049abbf6b7fb0ffa
parentdc55240fe8ce2f27aaca05a5287089080c902c85 (diff)
downloadfreeipa-f43f6c50c6d6c0f456ef30a9887dd6649ac9b879.tar.gz
freeipa-f43f6c50c6d6c0f456ef30a9887dd6649ac9b879.tar.xz
freeipa-f43f6c50c6d6c0f456ef30a9887dd6649ac9b879.zip
Only change the log level if it isn't already set
This primarily affects the installer. We want to log to the install/ uninstall file in DEBUG. This was getting reset to INFO causing lots of details to not show in the logs.
-rw-r--r--ipalib/plugable.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/ipalib/plugable.py b/ipalib/plugable.py
index b6ba73255..6b2c6f7d0 100644
--- a/ipalib/plugable.py
+++ b/ipalib/plugable.py
@@ -365,10 +365,11 @@ class API(DictProxy):
self.env._finalize_core(**dict(DEFAULT_CONFIG))
log = logging.getLogger()
object.__setattr__(self, 'log', log)
- if self.env.debug:
- log.setLevel(logging.DEBUG)
- else:
- log.setLevel(logging.INFO)
+ if log.level == logging.NOTSET:
+ if self.env.debug:
+ log.setLevel(logging.DEBUG)
+ else:
+ log.setLevel(logging.INFO)
# Add stderr handler:
stderr = logging.StreamHandler()