refactor(logging): preserve tracebacks in remaining except blocks

Follow-up to PR #3651:

- Replace logger.error with logger.exception inside except blocks
  so stack traces are no longer lost:
  - providers/transcription.py (5 occurrences)
  - agent/tools/mcp.py (1 occurrence)

- Replace stdlib logging.getLogger with loguru logger in
  providers/openai_compat_provider.py for consistency.
This commit is contained in:
chengyongru
2026-05-07 13:06:59 +08:00
committed by Xubin Ren
parent 44a341335a
commit 9a8c4da0c4
3 changed files with 7 additions and 8 deletions
+1 -2
View File
@@ -24,8 +24,7 @@ if os.environ.get("LANGFUSE_SECRET_KEY") and importlib.util.find_spec("langfuse"
from langfuse.openai import AsyncOpenAI
else:
if os.environ.get("LANGFUSE_SECRET_KEY"):
import logging
logging.getLogger(__name__).warning(
logger.warning(
"LANGFUSE_SECRET_KEY is set but langfuse is not installed; "
"install with `pip install langfuse` to enable tracing"
)