Skip to content

Commit 13a2231

Browse files
mmeclaude
authored andcommitted
chore: replace debug print statements with logging
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9a3606d commit 13a2231

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

patterns/langgraph-single-agent/langgraph_agent.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import base64
77
import json
88
import os
9-
import traceback
109
import logging
1110

1211
from ag_ui.core import RunAgentInput, RunErrorEvent, RunFinishedEvent
@@ -135,10 +134,8 @@ async def create_langgraph_agent(tools: list):
135134
system_prompt=SYSTEM_PROMPT,
136135
state_schema=AgentState, # extends BaseAgentState with todos: list[Todo]
137136
)
138-
except Exception as error:
139-
print(f"[AGENT ERROR] Error creating LangGraph agent: {error}")
140-
print(f"[AGENT ERROR] Exception type: {type(error).__name__}")
141-
traceback.print_exc()
137+
except Exception:
138+
logging.exception("Error creating LangGraph agent")
142139
raise
143140

144141

0 commit comments

Comments
 (0)