Commit bc7e34f6 authored by Vinay Sajip's avatar Vinay Sajip

Issue #3389: Allow resolving dotted names for handlers in logging...

Issue #3389: Allow resolving dotted names for handlers in logging configuration files. Thanks to Philip Jenvey for the patch.
parent 0bd10fd5
...@@ -146,7 +146,10 @@ def _install_handlers(cp, formatters): ...@@ -146,7 +146,10 @@ def _install_handlers(cp, formatters):
fmt = cp.get(sectname, "formatter") fmt = cp.get(sectname, "formatter")
else: else:
fmt = "" fmt = ""
klass = eval(klass, vars(logging)) try:
klass = eval(klass, vars(logging))
except (AttributeError, NameError):
klass = _resolve(klass)
args = cp.get(sectname, "args") args = cp.get(sectname, "args")
args = eval(args, vars(logging)) args = eval(args, vars(logging))
h = apply(klass, args) h = apply(klass, args)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment