summaryrefslogtreecommitdiffstats
path: root/Lib/logging/config.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/logging/config.py')
-rw-r--r--Lib/logging/config.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/logging/config.py b/Lib/logging/config.py
index fa1a398..cfd9311 100644
--- a/Lib/logging/config.py
+++ b/Lib/logging/config.py
@@ -666,11 +666,19 @@ class DictConfigurator(BaseConfigurator):
dfmt = config.get('datefmt', None)
style = config.get('style', '%')
cname = config.get('class', None)
+
if not cname:
c = logging.Formatter
else:
c = _resolve(cname)
- result = c(fmt, dfmt, style)
+
+ # A TypeError would be raised if "validate" key is passed in with a formatter callable
+ # that does not accept "validate" as a parameter
+ if 'validate' in config: # if user hasn't mentioned it, the default will be fine
+ result = c(fmt, dfmt, style, config['validate'])
+ else:
+ result = c(fmt, dfmt, style)
+
return result
def configure_filter(self, config):