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]))
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)
def test_many_debug(self): for i in range(100): icon_logger.debug(IconLoggerUtil.make_log_msg(TAG, f'debug log{i}'))
def test_error(self): icon_logger.error(IconLoggerUtil.make_log_msg(TAG, 'error log'))
def test_exception(self): try: raise Exception() except: icon_logger.exception(IconLoggerUtil.make_log_msg(TAG, 'exception log'))
def test_warning(self): icon_logger.warning(IconLoggerUtil.make_log_msg(TAG, 'warning log'))
def test_info(self): icon_logger.info(IconLoggerUtil.make_log_msg(TAG, 'info log'))
def test_debug(self): icon_logger.debug(IconLoggerUtil.make_log_msg(TAG, 'debug log'))