Lines Matching full:handlers
23 import logging.handlers
110 hlist = self.logger1.handlers + self.root_logger.handlers
111 raise AssertionError('Unexpected handlers: %s' % hlist)
113 hlist = self.logger2.handlers + self.root_logger.handlers
114 raise AssertionError('Unexpected handlers: %s' % hlist)
124 while self.root_logger.handlers:
125 h = self.root_logger.handlers[0]
343 handler = self.root_logger.handlers[0]
372 handler = self.root_logger.handlers[0]
482 self.root_logger.handlers[0].setLevel(SOCIABLE)
494 self.root_logger.handlers[0].setLevel(logging.NOTSET)
499 handler = self.root_logger.handlers[0]
549 # We can't actually *use* too many handlers in the tests,
557 h = logging.handlers.WatchedFileHandler(fn, delay=True)
581 h = logging.handlers.SysLogHandler(sockname)
589 self.assertRaises(ValueError, logging.handlers.HTTPHandler,
592 h = logging.handlers.HTTPHandler('localhost', '/log', method)
594 h = logging.handlers.BufferingHandler(0)
598 h = logging.handlers.BufferingHandler(1)
604 Test that Path objects are accepted as filename arguments to handlers.
614 (logging.handlers.RotatingFileHandler, (pfn, 'a')),
615 (logging.handlers.TimedRotatingFileHandler, (pfn, 'h')),
618 cases += ((logging.handlers.WatchedFileHandler, (pfn, 'w')),)
649 h = logging.handlers.WatchedFileHandler(fn, delay=delay)
1050 h = logging.handlers.SMTPHandler(addr, 'me', 'you', 'Log',
1081 self.mem_hdlr = logging.handlers.MemoryHandler(10, logging.WARNING,
1136 self.mem_hdlr = logging.handlers.MemoryHandler(10, logging.WARNING,
1168 [handlers]
1176 handlers=hand1
1194 [handlers]
1202 handlers=
1206 handlers=hand1
1226 [handlers]
1234 handlers=hand1
1238 handlers=
1264 [handlers]
1272 handlers=hand1
1289 # config6 uses ', ' delimiters in the handlers and formatters sections
1294 [handlers]
1302 handlers=
1306 handlers=hand1
1336 [handlers]
1344 handlers=hand1
1348 handlers=
1354 handlers=
1374 [handlers]
1382 handlers=file
1394 [handlers]
1402 handlers=screen
1555 handler = logging.root.handlers[0]
1575 [handlers]
1587 handlers=console
1634 hcls = logging.handlers.SocketHandler
1640 self.root_logger.removeHandler(self.root_logger.handlers[0])
1748 hcls = logging.handlers.DatagramHandler
1754 self.root_logger.removeHandler(self.root_logger.handlers[0])
1829 hcls = logging.handlers.SysLogHandler
1835 self.root_logger.removeHandler(self.root_logger.handlers[0])
1933 root_logger.removeHandler(self.root_logger.handlers[0])
1957 self.h_hdlr = logging.handlers.HTTPHandler(host, '/frob',
2118 self.assertEqual(logger.handlers, [])
2121 self.assertEqual(len(logger.handlers), 1)
2122 self.assertIsInstance(logger.handlers[0], logging.NullHandler)
2149 'handlers' : {
2159 'handlers' : ['hand1'],
2171 'handlers' : {
2182 'handlers' : ['hand1'],
2198 'handlers' : {
2213 'handlers' : ['hand1'],
2225 'handlers' : {
2236 'handlers' : ['hand1'],
2252 'handlers' : {
2263 'handlers' : ['hand1'],
2280 'handlers' : {
2291 'handlers' : ['hand1'],
2307 'handlers' : {
2318 'handlers' : ['hand1'],
2335 'handlers' : {
2345 'handlers' : ['hand1'],
2366 'handlers' : {
2379 'handlers' : ['hand1'],
2391 'handlers' : {
2402 'handlers' : ['hand1'],
2419 'handlers' : {
2431 'handlers' : ['hand1'],
2448 'handlers' : {
2459 'handlers' : ['hand1'],
2478 'handlers' : {
2489 'handlers' : ['hand1'],
2508 'handlers' : {
2519 'handlers' : ['hand1'],
2536 'handlers' : {
2547 'handlers' : ['hand1'],
2558 'handlers' : {
2573 'handlers' : {
2598 'handlers' : {
2615 'handlers' : ['hand1'],
2636 'handlers' : {
2642 'handlers' : ['hand1'],
2666 'handlers' : {
2672 'handlers' : ['hand1'],
2697 'handlers' : {
2703 'handlers' : ['hand1'],
2719 'handlers' : {
2733 'handlers' : ['hand1'],
2745 "handlers": {
2752 "class": "logging.handlers.MemoryHandler",
2762 "handlers": ["bufferGlobal"],
3025 "handlers": {
3032 "handlers": ["file"]
3039 handler = logging.root.handlers[0]
3167 handler = logging.getLogger('mymodule').handlers[0]
3279 self.que_hdlr = logging.handlers.QueueHandler(self.queue)
3315 @unittest.skipUnless(hasattr(logging.handlers, 'QueueListener'),
3316 'logging.handlers.QueueListener required for this test')
3319 listener = logging.handlers.QueueListener(self.queue, handler)
3336 listener = logging.handlers.QueueListener(self.queue, handler,
3350 @unittest.skipUnless(hasattr(logging.handlers, 'QueueListener'),
3351 'logging.handlers.QueueListener required for this test')
3354 listener = logging.handlers.QueueListener(self.queue, self.root_hdlr)
3364 if hasattr(logging.handlers, 'QueueListener'):
3385 handler = logging.handlers.QueueHandler(log_queue)
3387 listener = logging.handlers.QueueListener(log_queue)
3400 @patch.object(logging.handlers.QueueListener, 'handle')
3408 @patch.object(logging.handlers.QueueListener, 'handle')
3447 expected = [[], [logging.handlers.QueueListener._sentinel]]
3619 # No handlers and no last resort, so 'No handlers' message
3623 msg = 'No handlers could be found for logger "root"\n'
3626 # 'No handlers' message only printed once
3683 # create some fake handlers
3688 # create live weakref to those handlers
3689 handlers = map(logging.weakref.ref, [handler0, handler1, handler2])
3691 logging.shutdown(handlerList=list(handlers))
3701 handlers = [logging.weakref.ref(handler)]
3703 logging.shutdown(handlerList=list(handlers))
3904 self.handlers = logging.root.handlers
3909 logging.root.handlers = []
3912 for h in logging.root.handlers[:]:
3918 setattr(logging.root, 'handlers', self.handlers)
3928 self.assertEqual(len(logging.root.handlers), 1)
3929 handler = logging.root.handlers[0]
3969 self.assertEqual(len(logging.root.handlers), 1)
3970 handler = logging.root.handlers[0]
3987 handler = logging.root.handlers[0]
3997 self.assertEqual(len(logging.root.handlers), 1)
3998 handler = logging.root.handlers[0]
4005 formatter = logging.root.handlers[0].formatter
4011 formatter = logging.root.handlers[0].formatter
4017 formatter = logging.root.handlers[0].formatter
4032 handlers = [logging.StreamHandler()]
4037 handlers=handlers)
4039 handlers=handlers)
4046 handlers = [
4052 handlers[2].setFormatter(f)
4053 logging.basicConfig(handlers=handlers)
4054 self.assertIs(handlers[0], logging.root.handlers[0])
4055 self.assertIs(handlers[1], logging.root.handlers[1])
4056 self.assertIs(handlers[2], logging.root.handlers[2])
4057 self.assertIsNotNone(handlers[0].formatter)
4058 self.assertIsNotNone(handlers[1].formatter)
4059 self.assertIs(handlers[2].formatter, f)
4060 self.assertIs(handlers[0].formatter, handlers[1].formatter)
4063 # logging.root has no handlers so basicConfig should be called
4172 for handler in self.logger.handlers:
4286 for handler in self.logger.handlers:
4423 rh = logging.handlers.RotatingFileHandler(self.fn, maxBytes=0)
4428 rh = logging.handlers.RotatingFileHandler(self.fn, maxBytes=1)
4435 rh = logging.handlers.RotatingFileHandler(self.fn)
4443 rh = logging.handlers.RotatingFileHandler(
4468 rh = logging.handlers.RotatingFileHandler(
4503 fh = logging.handlers.TimedRotatingFileHandler(self.fn, 'S',
4546 assertRaises(ValueError, logging.handlers.TimedRotatingFileHandler,
4548 assertRaises(ValueError, logging.handlers.TimedRotatingFileHandler,
4550 assertRaises(ValueError, logging.handlers.TimedRotatingFileHandler,
4556 rh = logging.handlers.TimedRotatingFileHandler(
4577 rh = logging.handlers.TimedRotatingFileHandler(
4622 rh = logging.handlers.TimedRotatingFileHandler(
4640 r = logging.handlers._MIDNIGHT - ((currentHour * 60 +
4665 h = logging.handlers.NTEventLogHandler('test_logging')
4722 if hasattr(logging.handlers, 'QueueListener'):