diff options
| author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2006-12-11 14:26:23 (GMT) | 
|---|---|---|
| committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2006-12-11 14:26:23 (GMT) | 
| commit | 66a17266206cb70bf07c2df93b3536d3c70a5121 (patch) | |
| tree | fd3c242c368653f5a650a33426a80dae29185ddb /Lib/logging/config.py | |
| parent | 5492e1722af1ce85b8248e30cf35e957429d161d (diff) | |
| download | cpython-66a17266206cb70bf07c2df93b3536d3c70a5121.zip cpython-66a17266206cb70bf07c2df93b3536d3c70a5121.tar.gz cpython-66a17266206cb70bf07c2df93b3536d3c70a5121.tar.bz2  | |
Patch by "cuppatea" (SF #1503765)
Diffstat (limited to 'Lib/logging/config.py')
| -rw-r--r-- | Lib/logging/config.py | 9 | 
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/logging/config.py b/Lib/logging/config.py index f14eb12..11d2b7a 100644 --- a/Lib/logging/config.py +++ b/Lib/logging/config.py @@ -110,7 +110,7 @@ def _create_formatters(cp):      flist = string.split(flist, ",")      formatters = {}      for form in flist: -        sectname = "formatter_%s" % form +        sectname = "formatter_%s" % string.strip(form)          opts = cp.options(sectname)          if "format" in opts:              fs = cp.get(sectname, "format", 1) @@ -139,7 +139,7 @@ def _install_handlers(cp, formatters):      handlers = {}      fixups = [] #for inter-handler references      for hand in hlist: -        sectname = "handler_%s" % hand +        sectname = "handler_%s" % string.strip(hand)          klass = cp.get(sectname, "class")          opts = cp.options(sectname)          if "formatter" in opts: @@ -176,6 +176,7 @@ def _install_loggers(cp, handlers):      # configure the root first      llist = cp.get("loggers", "keys")      llist = string.split(llist, ",") +    llist = map(lambda x: string.strip(x), llist)      llist.remove("root")      sectname = "logger_root"      root = logging.root @@ -190,7 +191,7 @@ def _install_loggers(cp, handlers):      if len(hlist):          hlist = string.split(hlist, ",")          for hand in hlist: -            log.addHandler(handlers[hand]) +            log.addHandler(handlers[string.strip(hand)])      #and now the others...      #we don't want to lose the existing loggers, @@ -225,7 +226,7 @@ def _install_loggers(cp, handlers):          if len(hlist):              hlist = string.split(hlist, ",")              for hand in hlist: -                logger.addHandler(handlers[hand]) +                logger.addHandler(handlers[string.strip(hand)])      #Disable any old loggers. There's no point deleting      #them as other threads may continue to hold references  | 
