Exemple #1
0
 def test_exc_log_path(self):
     cases = [
         ['./log/iconservice.log', './log/iconservice_exc.log'],
         ['/.log/icon.log', '/.log/icon_exc.log'],
         ['./log/iconservice', './log/iconservice_exc'],
     ]
     for c in cases:
         self.assertEqual(c[1], IconLoggerUtil._make_exc_log_path(c[0]))
Exemple #2
0
    def setUpClass(cls):
        conf = IconConfig(str(), default_icon_config)
        conf.load()
        IconLoggerUtil.apply_config(icon_logger, conf)
        IconLoggerUtil.print_config(icon_logger, conf)

        file_path = os.path.join(os.path.dirname(__file__), 'logger.json')
        conf = IconConfig(file_path, default_icon_config)
        conf.load()
        IconLoggerUtil.apply_config(icon_logger, conf)
        IconLoggerUtil.print_config(icon_logger, conf)
Exemple #3
0
 def test_many_debug(self):
     for i in range(100):
         icon_logger.debug(IconLoggerUtil.make_log_msg(TAG, f'debug log{i}'))
Exemple #4
0
 def test_error(self):
     icon_logger.error(IconLoggerUtil.make_log_msg(TAG, 'error log'))
Exemple #5
0
 def test_exception(self):
     try:
         raise Exception()
     except:
         icon_logger.exception(IconLoggerUtil.make_log_msg(TAG, 'exception log'))
Exemple #6
0
 def test_warning(self):
     icon_logger.warning(IconLoggerUtil.make_log_msg(TAG, 'warning log'))
Exemple #7
0
 def test_info(self):
     icon_logger.info(IconLoggerUtil.make_log_msg(TAG, 'info log'))
Exemple #8
0
 def test_debug(self):
     icon_logger.debug(IconLoggerUtil.make_log_msg(TAG, 'debug log'))