diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-10-19 20:44:14 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-10-19 20:44:14 (GMT) |
commit | 6fac8171367e0f2626613eb0ac07fc79c25f2500 (patch) | |
tree | 3f1babd6f2fab6651ac594da2ad926f65fccac9b /Lib/logging | |
parent | 7004bd1a3de06330761d164bae0d82c597bf39cf (diff) | |
download | cpython-6fac8171367e0f2626613eb0ac07fc79c25f2500.zip cpython-6fac8171367e0f2626613eb0ac07fc79c25f2500.tar.gz cpython-6fac8171367e0f2626613eb0ac07fc79c25f2500.tar.bz2 |
logging: Added tests for _logRecordClass changes.
Diffstat (limited to 'Lib/logging')
-rw-r--r-- | Lib/logging/__init__.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 0c6a186..995d313 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -973,6 +973,7 @@ class Manager(object): self.emittedNoHandlerWarning = 0 self.loggerDict = {} self.loggerClass = None + self.logRecordClass = None def getLogger(self, name): """ @@ -1016,6 +1017,13 @@ class Manager(object): + klass.__name__) self.loggerClass = klass + def setLogRecordClass(self, cls): + """ + Set the class to be used when instantiating a log record with this + Manager. + """ + self.logRecordClass = cls + def _fixupParents(self, alogger): """ Ensure that there are either loggers or placeholders all the way |