summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_logging.py
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2010-12-03 11:50:38 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2010-12-03 11:50:38 (GMT)
commit615615291f8a59ff194cadb67e9898575061aaa5 (patch)
treee0bca985218f63bb2ead7122fb512fcf9696df4b /Lib/test/test_logging.py
parent97cbb76ee31b4b91fd908576bbc3354ceab41cfc (diff)
downloadcpython-615615291f8a59ff194cadb67e9898575061aaa5.zip
cpython-615615291f8a59ff194cadb67e9898575061aaa5.tar.gz
cpython-615615291f8a59ff194cadb67e9898575061aaa5.tar.bz2
logging: Added getLogRecordFactory/setLogRecordFactory with docs and tests.
Diffstat (limited to 'Lib/test/test_logging.py')
-rw-r--r--Lib/test/test_logging.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index 01c3336..cd8cdbd 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -1799,7 +1799,7 @@ class ChildLoggerTest(BaseTest):
class DerivedLogRecord(logging.LogRecord):
pass
-class LogRecordClassTest(BaseTest):
+class LogRecordFactoryTest(BaseTest):
def setUp(self):
class CheckingFilter(logging.Filter):
@@ -1817,17 +1817,17 @@ class LogRecordClassTest(BaseTest):
BaseTest.setUp(self)
self.filter = CheckingFilter(DerivedLogRecord)
self.root_logger.addFilter(self.filter)
- self.orig_cls = logging.getLogRecordClass()
+ self.orig_factory = logging.getLogRecordFactory()
def tearDown(self):
self.root_logger.removeFilter(self.filter)
BaseTest.tearDown(self)
- logging.setLogRecordClass(self.orig_cls)
+ logging.setLogRecordFactory(self.orig_factory)
def test_logrecord_class(self):
self.assertRaises(TypeError, self.root_logger.warning,
self.next_message())
- logging.setLogRecordClass(DerivedLogRecord)
+ logging.setLogRecordFactory(DerivedLogRecord)
self.root_logger.error(self.next_message())
self.assert_log_lines([
('root', 'ERROR', '2'),
@@ -2015,7 +2015,7 @@ def test_main():
ConfigFileTest, SocketHandlerTest, MemoryTest,
EncodingTest, WarningsTest, ConfigDictTest, ManagerTest,
FormatterTest,
- LogRecordClassTest, ChildLoggerTest, QueueHandlerTest,
+ LogRecordFactoryTest, ChildLoggerTest, QueueHandlerTest,
RotatingFileHandlerTest,
#TimedRotatingFileHandlerTest
)