Lines Matching full:handlers
31 import logging.handlers
84 # Handlers add themselves to logging._handlers
85 handlers = _install_handlers(cp, formatters)
86 _install_loggers(cp, handlers, disable_existing_loggers)
141 """Install and return handlers"""
142 hlist = cp.get("handlers", "keys")
147 handlers = {}
169 if issubclass(klass, logging.handlers.MemoryHandler):
176 handlers[hand] = h
177 #now all handlers are loaded, fixup inter-handler references...
179 h.setTarget(handlers[t])
180 return handlers
183 def _install_loggers(cp, handlers, disable_existing_loggers): argument
198 for h in root.handlers[:]:
200 hlist = cp.get(sectname, "handlers")
205 log.addHandler(handlers[hand])
248 for h in logger.handlers[:]:
252 hlist = cp.get(sectname, "handlers")
257 logger.addHandler(handlers[hand])
268 logger.handlers = []
508 handlers = config.get('handlers', EMPTY_DICT)
509 for name in handlers:
516 handler_config = handlers[name]
561 # Next, do handlers - they refer to formatters and filters
562 # As handlers can refer to other handlers, sort the keys
564 handlers = config.get('handlers', EMPTY_DICT)
566 for name in sorted(handlers):
568 handler = self.configure_handler(handlers[name])
570 handlers[name] = handler
581 handler = self.configure_handler(handlers[name])
583 handlers[name] = handler
588 # Next, do loggers - they refer to handlers and filters
638 logger.handlers = []
713 if issubclass(klass, logging.handlers.MemoryHandler) and\
716 th = self.config['handlers'][config['target']]
724 elif issubclass(klass, logging.handlers.SMTPHandler) and\
727 elif issubclass(klass, logging.handlers.SysLogHandler) and\
751 def add_handlers(self, logger, handlers): argument
752 """Add handlers to a logger from a list of names."""
753 for h in handlers:
755 logger.addHandler(self.config['handlers'][h])
767 #Remove any existing handlers
768 for h in logger.handlers[:]:
770 handlers = config.get('handlers', None)
771 if handlers:
772 self.add_handlers(logger, handlers)