fix(T-002): remove sensitive info from logs
- alibaba.py: remove translated text content from log, only log char count - nvidia.py: remove messages content reference from timing log - push.py: replace full content with length, sanitize WeChat error response
This commit is contained in:
@@ -67,7 +67,7 @@ class AlibabaMTProvider:
|
|||||||
detected = data.get("DetectedLanguage", src)
|
detected = data.get("DetectedLanguage", src)
|
||||||
|
|
||||||
if translated:
|
if translated:
|
||||||
logger.info(f"Alibaba MT [{version}] ok: {text[:20]}... -> {translated[:20]}...")
|
logger.info(f"Alibaba MT [{version}] ok: {len(text)} chars translated")
|
||||||
return {
|
return {
|
||||||
"translated_text": translated,
|
"translated_text": translated,
|
||||||
"provider": f"{self.name}-{version}",
|
"provider": f"{self.name}-{version}",
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class NvidiaProvider(OpenAIProvider):
|
|||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
f"NVIDIA timing: build_msgs={t1-t0:.1f}s api_call={t2-t1:.1f}s process={t3-t2:.1f}s "
|
f"NVIDIA timing: build_msgs={t1-t0:.1f}s api_call={t2-t1:.1f}s process={t3-t2:.1f}s "
|
||||||
f"chars_in={sum(len(m.get('content','')) for m in messages)} chars_out={len(content)}"
|
f"chars_out={len(content)}"
|
||||||
)
|
)
|
||||||
|
|
||||||
return {"reply": content, "provider": self.name, "model": self.model}
|
return {"reply": content, "provider": self.name, "model": self.model}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class PushService:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def send_notification(user_id: str, title: str, content: str, payload: Optional[Dict[str, Any]] = None) -> bool:
|
def send_notification(user_id: str, title: str, content: str, payload: Optional[Dict[str, Any]] = None) -> bool:
|
||||||
logger.info(f"[PUSH] user={user_id} title={title} content={content}")
|
logger.info(f"[PUSH] user={user_id} title={title} content_len={len(content)}")
|
||||||
try:
|
try:
|
||||||
import asyncio
|
import asyncio
|
||||||
loop = asyncio.new_event_loop()
|
loop = asyncio.new_event_loop()
|
||||||
|
|||||||
Reference in New Issue
Block a user