|
@@ -11,11 +11,9 @@ from data_clean.env.const import mongo_table_prefix
|
|
from data_clean.exception.fetch_exception import FetchException
|
|
from data_clean.exception.fetch_exception import FetchException
|
|
from data_clean.exception.ruler_validation_exception import RulerValidationException
|
|
from data_clean.exception.ruler_validation_exception import RulerValidationException
|
|
from data_clean.statistic.data_clean_statistic import ruler_error, error
|
|
from data_clean.statistic.data_clean_statistic import ruler_error, error
|
|
-from data_clean.utils import get_log
|
|
|
|
|
|
+from loguru import logger as log
|
|
from data_clean.utils.date_utils import get_now_datetime
|
|
from data_clean.utils.date_utils import get_now_datetime
|
|
|
|
|
|
-log = get_log("exception_handler")
|
|
|
|
-
|
|
|
|
|
|
|
|
async def ruler_valid_exception_sink(ex: RulerValidationException, tn: str, data, session_id):
|
|
async def ruler_valid_exception_sink(ex: RulerValidationException, tn: str, data, session_id):
|
|
"""
|
|
"""
|
|
@@ -129,17 +127,17 @@ def exception_handle(func):
|
|
try:
|
|
try:
|
|
result = await func(self, *args, **kwargs)
|
|
result = await func(self, *args, **kwargs)
|
|
except RulerValidationException as ex:
|
|
except RulerValidationException as ex:
|
|
- log.warn("session_id: %s 维度:%s ,detail: %s", session_id, tn, ex)
|
|
|
|
|
|
+ log.warning("session_id: {} 维度:{} ,detail: {}", session_id, tn, ex)
|
|
data = args[0]
|
|
data = args[0]
|
|
data = _handle(data, tn, session_id, ex, original_data)
|
|
data = _handle(data, tn, session_id, ex, original_data)
|
|
await ruler_valid_exception_sink(ex, tn, data, session_id)
|
|
await ruler_valid_exception_sink(ex, tn, data, session_id)
|
|
except FetchException as ex:
|
|
except FetchException as ex:
|
|
- log.error("session_id: %s 维度:%s ,detail: %s", session_id, tn, ex)
|
|
|
|
|
|
+ log.error("session_id: {} 维度:{} ,detail: {}", session_id, tn, ex)
|
|
data = args[0]
|
|
data = args[0]
|
|
data = _handle(data, tn, session_id, ex, original_data)
|
|
data = _handle(data, tn, session_id, ex, original_data)
|
|
await fetch_exception_sink(ex, tn, data, session_id)
|
|
await fetch_exception_sink(ex, tn, data, session_id)
|
|
except Exception as ex:
|
|
except Exception as ex:
|
|
- log.error("session_id: %s 维度:%s ,出现未知异常:%s", session_id, tn, repr(ex))
|
|
|
|
|
|
+ log.error("session_id: {} 维度:{} ,出现未知异常:{}", session_id, tn, repr(ex))
|
|
data = args[0]
|
|
data = args[0]
|
|
data = _handle(data, tn, session_id, ex, original_data)
|
|
data = _handle(data, tn, session_id, ex, original_data)
|
|
await error_sink(ex, tn, data, session_id)
|
|
await error_sink(ex, tn, data, session_id)
|