refactor: unify core pipeline logging with cs_agent logger
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
import re
|
||||
from typing import Any
|
||||
|
||||
from utils.metrics_tracker import emit as metrics_emit
|
||||
|
||||
CASE_LIBRARY_LINK = "https://www.yuque.com/zuowei-dfvpq/kge0in/mynala0g35b8cec5"
|
||||
logger = logging.getLogger("cs_agent")
|
||||
|
||||
|
||||
def detect_price(reply: str, state: Any) -> None:
|
||||
@@ -102,9 +104,9 @@ async def record_deal_success(
|
||||
db.clear_quote_no_convert(customer_id)
|
||||
except Exception:
|
||||
pass
|
||||
print(f"[Agent] 成交记录: {customer_id} {reason} {amount}元")
|
||||
logger.info("[Agent] 成交记录: %s %s %s元", customer_id, reason, amount)
|
||||
except Exception as e:
|
||||
print(f"[Agent] 成交记录失败: {e}")
|
||||
logger.exception("[Agent] 成交记录失败: %s", e)
|
||||
|
||||
|
||||
async def record_deal_fail(
|
||||
@@ -128,9 +130,9 @@ async def record_deal_fail(
|
||||
platform=platform or "",
|
||||
)
|
||||
db.mark_quote_no_convert(customer_id)
|
||||
print(f"[Agent] 未成交记录: {customer_id} {reason}")
|
||||
logger.info("[Agent] 未成交记录: %s %s", customer_id, reason)
|
||||
except Exception as e:
|
||||
print(f"[Agent] 未成交记录失败: {e}")
|
||||
logger.exception("[Agent] 未成交记录失败: %s", e)
|
||||
|
||||
|
||||
async def auto_tag(message: Any, state: Any) -> None:
|
||||
|
||||
Reference in New Issue
Block a user