summaryrefslogtreecommitdiff
path: root/GstDebugViewer
diff options
context:
space:
mode:
authorRené Stadler <mail@renestadler.de>2008-11-29 21:06:52 +0200
committerRené Stadler <mail@renestadler.de>2008-11-29 21:10:42 +0200
commitfe299ba21edd0999080b6772d3d1b3053e0baf6f (patch)
tree4fc5678d30222232e7662f34c9a776c6b03225d5 /GstDebugViewer
parent6d3972f68d5a833d8d7def6f554a17207f7627f5 (diff)
Fix logging being on by default with recent Python
The fix for Python issue #1021 uncovered a mistake of mine. I was under the impression that logging.NOTSET level means "off", but in fact it means to not modify the level, and setting that on the root logger with basicConfig leads to turning on all levels.
Diffstat (limited to 'GstDebugViewer')
-rw-r--r--GstDebugViewer/Common/Main.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/GstDebugViewer/Common/Main.py b/GstDebugViewer/Common/Main.py
index e066331..63071ec 100644
--- a/GstDebugViewer/Common/Main.py
+++ b/GstDebugViewer/Common/Main.py
@@ -400,15 +400,15 @@ class LogOptionParser (OptionParser):
try:
level = int (arg)
except ValueError:
- level = {"off" : logging.NOTSET,
- "none" : logging.NOTSET,
+ level = {"off" : None,
+ "none" : None,
"debug" : logging.DEBUG,
"info" : logging.INFO,
"warning" : logging.WARNING,
"error" : logging.ERROR,
"critical" : logging.CRITICAL}.get (arg.strip ().lower ())
if level is None:
- return logging.NOTSET
+ return None
else:
return level
else:
@@ -416,7 +416,7 @@ class LogOptionParser (OptionParser):
level = 0
elif level > 5:
level = 5
- return {0 : logging.NOTSET,
+ return {0 : None,
1 : logging.DEBUG,
2 : logging.INFO,
3 : logging.WARNING,
@@ -461,7 +461,7 @@ def _init_options (option_parser = None):
return option_parser.options
-def _init_logging (level = logging.NOTSET):
+def _init_logging (level = None):
logging.basicConfig (level = level,
format = '%(asctime)s.%(msecs)03d %(levelname)8s %(name)20s: %(message)s',