Issue #3389: Allow resolving dotted names for handlers in logging configuration files. Thanks to Philip Jenvey for the patch.

This commit is contained in:
Vinay Sajip 2008-07-18 08:59:06 +00:00
parent 0bd10fd5cc
commit bc7e34f692
1 changed files with 4 additions and 1 deletions

View File

@ -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)