• Home
  • Raw
  • Download

Lines Matching full:handlers

30 import logging.handlers
78 # Handlers add themselves to logging._handlers
79 handlers = _install_handlers(cp, formatters)
80 _install_loggers(cp, handlers, disable_existing_loggers)
125 """Install and return handlers"""
126 hlist = cp["handlers"]["keys"]
131 handlers = {}
151 if issubclass(klass, logging.handlers.MemoryHandler):
155 handlers[hand] = h
156 #now all handlers are loaded, fixup inter-handler references...
158 h.setTarget(handlers[t])
159 return handlers
177 logger.handlers = []
182 def _install_loggers(cp, handlers, disable_existing): argument
196 for h in root.handlers[:]:
198 hlist = section["handlers"]
203 log.addHandler(handlers[hand])
242 for h in logger.handlers[:]:
246 hlist = section["handlers"]
251 logger.addHandler(handlers[hand])
262 # logger.handlers = []
270 """Clear and close existing handlers"""
503 handlers = config.get('handlers', EMPTY_DICT)
504 for name in handlers:
511 handler_config = handlers[name]
555 # Next, do handlers - they refer to formatters and filters
556 # As handlers can refer to other handlers, sort the keys
558 handlers = config.get('handlers', EMPTY_DICT)
560 for name in sorted(handlers):
562 handler = self.configure_handler(handlers[name])
564 handlers[name] = handler
575 handler = self.configure_handler(handlers[name])
577 handlers[name] = handler
582 # Next, do loggers - they refer to handlers and filters
630 # logger.handlers = []
714 if issubclass(klass, logging.handlers.MemoryHandler) and\
717 th = self.config['handlers'][config['target']]
725 elif issubclass(klass, logging.handlers.SMTPHandler) and\
728 elif issubclass(klass, logging.handlers.SysLogHandler) and\
756 def add_handlers(self, logger, handlers): argument
757 """Add handlers to a logger from a list of names."""
758 for h in handlers:
760 logger.addHandler(self.config['handlers'][h])
772 #Remove any existing handlers
773 for h in logger.handlers[:]:
775 handlers = config.get('handlers', None)
776 if handlers:
777 self.add_handlers(logger, handlers)