diff options
author | Yuri Takhteyev <yuri@freewisdom.org> | 2008-10-06 12:11:47 -0700 |
---|---|---|
committer | Yuri Takhteyev <yuri@freewisdom.org> | 2008-10-06 12:11:47 -0700 |
commit | 2c6a74f6770982694113705e4d9467d471f899a6 (patch) | |
tree | e126763096745dd079e3734d7817ec6edafc7186 | |
parent | ca45f4c69eb87d4361a46d758a0936d63dbdee50 (diff) | |
download | markdown-2c6a74f6770982694113705e4d9467d471f899a6.tar.gz markdown-2c6a74f6770982694113705e4d9467d471f899a6.tar.bz2 markdown-2c6a74f6770982694113705e4d9467d471f899a6.zip |
Checking if logger level is set before changing it.
-rwxr-xr-x | markdown.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/markdown.py b/markdown.py index 0d92766..92529c0 100755 --- a/markdown.py +++ b/markdown.py @@ -34,13 +34,14 @@ import re, sys, codecs, htmlentitydefs from urlparse import urlparse, urlunparse from logging import getLogger, StreamHandler, Formatter, \ - DEBUG, INFO, WARN, ERROR, CRITICAL + NOTSET, DEBUG, INFO, WARN, ERROR, CRITICAL MESSAGE_THRESHOLD = CRITICAL # Configure debug message logger (the hard way - to support python 2.3) logger = getLogger('MARKDOWN') -logger.setLevel(DEBUG) # This is restricted by handlers later +if logger.level == NOTSET : + logger.setLevel(DEBUG) # This is restricted by handlers later console_hndlr = StreamHandler() formatter = Formatter('%(name)s-%(levelname)s: "%(message)s"') console_hndlr.setFormatter(formatter) |