mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
Issue #3389: Allow resolving dotted names for handlers in logging configuration files. Thanks to Philip Jenvey for the patch.
This commit is contained in:
parent
0bd10fd5cc
commit
bc7e34f692
1 changed files with 4 additions and 1 deletions
|
@ -146,7 +146,10 @@ def _install_handlers(cp, formatters):
|
|||
fmt = cp.get(sectname, "formatter")
|
||||
else:
|
||||
fmt = ""
|
||||
klass = eval(klass, vars(logging))
|
||||
try:
|
||||
klass = eval(klass, vars(logging))
|
||||
except (AttributeError, NameError):
|
||||
klass = _resolve(klass)
|
||||
args = cp.get(sectname, "args")
|
||||
args = eval(args, vars(logging))
|
||||
h = apply(klass, args)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue