def setUp(self):
        self.logger = l = logging.getLogger()
        self.adapter = LoggerAdapter(l, {})

        logger_dict = logging.getLogger().manager.loggerDict
        logging._acquireLock()
        try:
            self.saved_handlers = logging._handlers.copy()
            self.saved_handler_list = logging._handlerList[:]
            self.saved_loggers = logger_dict.copy()
            self.saved_level_names = logging._levelNames.copy()
        finally:
            logging._releaseLock()

        self.root_logger = logging.getLogger("")
        self.original_logging_level = self.root_logger.getEffectiveLevel()
Exemple #2
0
    def setUp(self):
        self.logger = temp_logger = logging.getLogger()
        self.adapter = LoggerAdapter(temp_logger, {})

        logger_dict = logging.getLogger().manager.loggerDict
        logging._acquireLock()
        try:
            self.saved_handlers = logging._handlers.copy()
            self.saved_handler_list = logging._handlerList[:]
            self.saved_loggers = logger_dict.copy()
            if hasattr(logging, '_levelNames'):
                self.saved_level_names = logging._levelNames.copy()
            else:
                self.saved_level_to_name = logging._levelToName.copy()
                self.saved_name_to_level = logging._nameToLevel.copy()
        finally:
            logging._releaseLock()

        self.root_logger = logging.getLogger("")
        self.original_logging_level = self.root_logger.getEffectiveLevel()
Exemple #3
0
 def setUp(self):
     self.handler = h = TestHandler(Matcher())
     self.logger = l = logging.getLogger()
     l.addHandler(h)
     self.adapter = LoggerAdapter(l, {})
Exemple #4
0
 def setUp(self):
     self.handler = h = TestHandler(Matcher())
     self.logger = temp_logger = logging.getLogger()
     temp_logger.addHandler(h)
     self.adapter = LoggerAdapter(temp_logger, {})