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.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/logging/config.py b/Lib/logging/config.py
index 7a2188f..21e10c1 100644
--- a/Lib/logging/config.py
+++ b/Lib/logging/config.py
@@ -474,6 +474,12 @@ class BaseConfigurator(object):
setattr(result, name, value)
return result
+ def as_tuple(self, value):
+ """Utility function which converts lists to tuples."""
+ if isinstance(value, list):
+ value = tuple(value)
+ return value
+
class DictConfigurator(BaseConfigurator):
"""
Configure logging using a dictionary-like object to describe the
@@ -688,6 +694,12 @@ class DictConfigurator(BaseConfigurator):
except StandardError, e:
raise ValueError('Unable to set target handler '
'%r: %s' % (config['target'], e))
+ elif issubclass(klass, logging.handlers.SMTPHandler) and\
+ 'mailhost' in config:
+ config['mailhost'] = self.as_tuple(config['mailhost'])
+ elif issubclass(klass, logging.handlers.SysLogHandler) and\
+ 'address' in config:
+ config['address'] = self.as_tuple(config['address'])
factory = klass
kwargs = dict([(k, config[k]) for k in config if valid_ident(k)])
try: