Skip to content

Commit 9b4b7b2

Browse files
committed
add a section on enabling the debug logs for embedded xaibo
1 parent 16978ac commit 9b4b7b2

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

docs/how-to/integrations/embed-xaibo-directly.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,35 @@ async def main():
8989
asyncio.run(main())
9090
```
9191

92-
## Optional: Add event listeners
92+
## Enable debug logging for web interface monitoring
9393

94-
Monitor agent activity by adding event listeners:
94+
Enable comprehensive debug logging to collect detailed execution traces that can be viewed in xaibo's web interface:
95+
96+
```python
97+
import logging
98+
from xaibo.primitives.event_listeners.debug_event_listener import register_debug_listener
99+
100+
# Configure logging to capture debug events
101+
logging.basicConfig(level=logging.DEBUG)
102+
103+
# Create xaibo instance and register debug listener
104+
xaibo = Xaibo()
105+
register_debug_listener(xaibo.event_registry, log_level=logging.INFO)
106+
107+
# Register your agent
108+
xaibo.register_agent(config)
109+
```
110+
111+
This captures all agent calls, results, and events with detailed information including:
112+
113+
- Method calls with arguments
114+
- Return values and execution results
115+
- Event timestamps and call IDs
116+
- Module and method names
117+
118+
## Optional: Add custom event listeners
119+
120+
Monitor specific agent activity by adding custom event listeners:
95121

96122
```python
97123
events = []

0 commit comments

Comments
 (0)