Lines Matching defs:handlers

23 import logging.handlers
120 hlist = self.logger1.handlers + self.root_logger.handlers
121 raise AssertionError('Unexpected handlers: %s' % hlist)
123 hlist = self.logger2.handlers + self.root_logger.handlers
124 raise AssertionError('Unexpected handlers: %s' % hlist)
134 while self.root_logger.handlers:
135 h = self.root_logger.handlers[0]
347 handler = self.root_logger.handlers[0]
376 handler = self.root_logger.handlers[0]
486 self.root_logger.handlers[0].setLevel(SOCIABLE)
498 self.root_logger.handlers[0].setLevel(logging.NOTSET)
503 handler = self.root_logger.handlers[0]
553 # We can't actually *use* too many handlers in the tests,
561 h = logging.handlers.WatchedFileHandler(fn, encoding='utf-8', delay=True)
585 h = logging.handlers.SysLogHandler(sockname)
593 self.assertRaises(ValueError, logging.handlers.HTTPHandler,
596 h = logging.handlers.HTTPHandler('localhost', '/log', method)
598 h = logging.handlers.BufferingHandler(0)
602 h = logging.handlers.BufferingHandler(1)
608 Test that Path objects are accepted as filename arguments to handlers.
618 (logging.handlers.RotatingFileHandler, (pfn, 'a')),
619 (logging.handlers.TimedRotatingFileHandler, (pfn, 'h')),
622 cases += ((logging.handlers.WatchedFileHandler, (pfn, 'w')),)
657 h = logging.handlers.WatchedFileHandler(fn, encoding='utf-8', delay=delay)
1079 h = logging.handlers.SMTPHandler(addr, 'me', 'you', 'Log',
1110 self.mem_hdlr = logging.handlers.MemoryHandler(10, logging.WARNING,
1165 self.mem_hdlr = logging.handlers.MemoryHandler(10, logging.WARNING,
1224 [handlers]
1232 handlers=hand1
1250 [handlers]
1258 handlers=
1262 handlers=hand1
1282 [handlers]
1290 handlers=hand1
1294 handlers=
1320 [handlers]
1328 handlers=hand1
1345 # config6 uses ', ' delimiters in the handlers and formatters sections
1350 [handlers]
1358 handlers=
1362 handlers=hand1
1392 [handlers]
1400 handlers=hand1
1404 handlers=
1410 handlers=
1430 [handlers]
1438 handlers=file
1451 [handlers]
1459 handlers=screen
1612 handler = logging.root.handlers[0]
1629 [handlers]
1636 handlers=hand1
1646 self.assertEqual(logging.getLogger().handlers[0].name, 'hand1')
1653 [handlers]
1660 handlers=hand1
1692 [handlers]
1704 handlers=console
1754 hcls = logging.handlers.SocketHandler
1760 self.root_logger.removeHandler(self.root_logger.handlers[0])
1870 hcls = logging.handlers.DatagramHandler
1876 self.root_logger.removeHandler(self.root_logger.handlers[0])
1953 hcls = logging.handlers.SysLogHandler
1959 self.root_logger.removeHandler(self.root_logger.handlers[0])
2067 root_logger.removeHandler(self.root_logger.handlers[0])
2091 self.h_hdlr = logging.handlers.HTTPHandler(host, '/frob',
2252 self.assertEqual(logger.handlers, [])
2255 self.assertEqual(len(logger.handlers), 1)
2256 self.assertIsInstance(logger.handlers[0], logging.NullHandler)
2287 'handlers' : {
2297 'handlers' : ['hand1'],
2309 'handlers' : {
2320 'handlers' : ['hand1'],
2336 'handlers' : {
2351 'handlers' : ['hand1'],
2363 'handlers' : {
2374 'handlers' : ['hand1'],
2390 'handlers' : {
2401 'handlers' : ['hand1'],
2418 'handlers' : {
2429 'handlers' : ['hand1'],
2445 'handlers' : {
2456 'handlers' : ['hand1'],
2473 'handlers' : {
2483 'handlers' : ['hand1'],
2504 'handlers' : {
2517 'handlers' : ['hand1'],
2529 'handlers' : {
2540 'handlers' : ['hand1'],
2557 'handlers' : {
2569 'handlers' : ['hand1'],
2586 'handlers' : {
2597 'handlers' : ['hand1'],
2616 'handlers' : {
2627 'handlers' : ['hand1'],
2646 'handlers' : {
2657 'handlers' : ['hand1'],
2674 'handlers' : {
2685 'handlers' : ['hand1'],
2696 'handlers' : {
2711 'handlers' : {
2736 'handlers' : {
2753 'handlers' : ['hand1'],
2774 'handlers' : {
2780 'handlers' : ['hand1'],
2804 'handlers' : {
2810 'handlers' : ['hand1'],
2835 'handlers' : {
2841 'handlers' : ['hand1'],
2857 'handlers' : {
2871 'handlers' : ['hand1'],
2883 "handlers": {
2890 "class": "logging.handlers.MemoryHandler",
2900 "handlers": ["bufferGlobal"],
2916 'handlers' : {
2927 "handlers": ["hand1"],
2943 'handlers' : {
2954 "handlers": ["hand1"],
2970 'handlers' : {
2981 "handlers": ["hand1"],
2997 'handlers' : {
3008 "handlers": ["hand1"],
3271 "handlers": {
3279 "handlers": ["file"]
3286 handler = logging.root.handlers[0]
3423 handler = logging.getLogger('mymodule').handlers[0]
3430 handler = logging.getLogger("my_test_logger_custom_formatter").handlers[0]
3435 handler = logging.getLogger("my_test_logger_custom_formatter").handlers[0]
3444 handler = logging.getLogger("my_test_logger_custom_formatter").handlers[0]
3493 'handlers': {
3499 'root': {'level': 'INFO', 'handlers': ['myhandler']},
3548 'handlers': {
3557 'handlers': ['console']
3659 self.que_hdlr = logging.handlers.QueueHandler(self.queue)
3695 @unittest.skipUnless(hasattr(logging.handlers, 'QueueListener'),
3696 'logging.handlers.QueueListener required for this test')
3699 listener = logging.handlers.QueueListener(self.queue, handler)
3716 listener = logging.handlers.QueueListener(self.queue, handler,
3730 @unittest.skipUnless(hasattr(logging.handlers, 'QueueListener'),
3731 'logging.handlers.QueueListener required for this test')
3734 listener = logging.handlers.QueueListener(self.queue, self.root_hdlr)
3746 @unittest.skipUnless(hasattr(logging.handlers, 'QueueListener'),
3747 'logging.handlers.QueueListener required for this test')
3753 listener = logging.handlers.QueueListener(self.queue, self.que_hdlr)
3759 if hasattr(logging.handlers, 'QueueListener'):
3781 handler = logging.handlers.QueueHandler(log_queue)
3783 listener = logging.handlers.QueueListener(log_queue)
3796 @patch.object(logging.handlers.QueueListener, 'handle')
3804 @patch.object(logging.handlers.QueueListener, 'handle')
3843 expected = [[], [logging.handlers.QueueListener._sentinel]]
3852 listener = logging.handlers.QueueListener(log_queue)
4228 # No handlers and no last resort, so 'No handlers' message
4232 msg = 'No handlers could be found for logger "root"\n'
4235 # 'No handlers' message only printed once
4292 # create some fake handlers
4297 # create live weakref to those handlers
4298 handlers = map(logging.weakref.ref, [handler0, handler1, handler2])
4300 logging.shutdown(handlerList=list(handlers))
4310 handlers = [logging.weakref.ref(handler)]
4312 logging.shutdown(handlerList=list(handlers))
4660 self.handlers = logging.root.handlers
4665 logging.root.handlers = []
4668 for h in logging.root.handlers[:]:
4674 setattr(logging.root, 'handlers', self.handlers)
4684 self.assertEqual(len(logging.root.handlers), 1)
4685 handler = logging.root.handlers[0]
4725 self.assertEqual(len(logging.root.handlers), 1)
4726 handler = logging.root.handlers[0]
4743 handler = logging.root.handlers[0]
4753 self.assertEqual(len(logging.root.handlers), 1)
4754 handler = logging.root.handlers[0]
4761 formatter = logging.root.handlers[0].formatter
4767 formatter = logging.root.handlers[0].formatter
4773 formatter = logging.root.handlers[0].formatter
4788 handlers = [logging.StreamHandler()]
4793 handlers=handlers)
4795 handlers=handlers)
4802 handlers = [
4808 handlers[2].setFormatter(f)
4809 logging.basicConfig(handlers=handlers)
4810 self.assertIs(handlers[0], logging.root.handlers[0])
4811 self.assertIs(handlers[1], logging.root.handlers[1])
4812 self.assertIs(handlers[2], logging.root.handlers[2])
4813 self.assertIsNotNone(handlers[0].formatter)
4814 self.assertIsNotNone(handlers[1].formatter)
4815 self.assertIs(handlers[2].formatter, f)
4816 self.assertIs(handlers[0].formatter, handlers[1].formatter)
4823 logging.basicConfig(level=logging.WARNING, handlers=old_handlers)
4827 self.assertEqual(len(logging.root.handlers), 1)
4828 logging.basicConfig(level=logging.INFO, handlers=new_handlers,
4833 self.assertEqual(len(logging.root.handlers), 1)
4846 self.assertEqual(len(logging.root.handlers), 1)
4847 handler = logging.root.handlers[0]
4866 self.assertEqual(len(logging.root.handlers), 1)
4867 handler = logging.root.handlers[0]
4884 self.assertEqual(len(logging.root.handlers), 1)
4885 handler = logging.root.handlers[0]
4906 self.assertEqual(len(logging.root.handlers), 1)
4907 handler = logging.root.handlers[0]
4933 # logging.root has no handlers so basicConfig should be called
5042 for handler in self.logger.handlers:
5200 for handler in self.logger.handlers:
5361 rh = logging.handlers.RotatingFileHandler(
5368 rh = logging.handlers.RotatingFileHandler(
5374 rh = logging.handlers.RotatingFileHandler(self.fn, encoding="utf-8", maxBytes=1)
5381 rh = logging.handlers.RotatingFileHandler(self.fn, encoding="utf-8")
5389 rh = logging.handlers.RotatingFileHandler(
5402 class HandlerWithNamerAndRotator(logging.handlers.RotatingFileHandler):
5433 rh = logging.handlers.RotatingFileHandler(
5469 fh = logging.handlers.TimedRotatingFileHandler(
5478 fh = logging.handlers.TimedRotatingFileHandler(
5521 assertRaises(ValueError, logging.handlers.TimedRotatingFileHandler,
5523 assertRaises(ValueError, logging.handlers.TimedRotatingFileHandler,
5525 assertRaises(ValueError, logging.handlers.TimedRotatingFileHandler,
5531 rh = logging.handlers.TimedRotatingFileHandler(
5552 rh = logging.handlers.TimedRotatingFileHandler(
5598 rotator = logging.handlers.TimedRotatingFileHandler(p, when='s',
5645 rh = logging.handlers.TimedRotatingFileHandler(
5663 r = logging.handlers._MIDNIGHT - ((currentHour * 60 +
5688 h = logging.handlers.NTEventLogHandler('test_logging')