| name | Debug |
| description | Use logging calls for in-depth debugging via local log files |
| user-invocable | true |
| agent-invocable | true |
Inject fetch() logging calls into user code that send structured data to a local HTTP ingest server. Log entries accumulate in JSONL files you can read for analysis.
Prerequisites
The env-snapshot includes a logIngest field once the ingest server is running:
logIngest: { port: <number>, token: "<uuid>" }
If logIngest is null, the server has not started yet — wait for an env-change.
Protocol
1. Create a log channel
Use write to create an empty JSONL file. The channel name must be kebab-case ([a-z0-9]+(-[a-z0-9]+)*).
write('logs/react-renders.jsonl', '')
This registers the channel. You will receive a log-channel-created env-change.
2. Construct the ingest URL
http://127.0.0.1:{port}/ingest/{channel-name}?token={token}
Example: http://127.0.0.1:54321/ingest/react-renders?token=abc-123
3. Inject instrumentation code
Wrap all injected debug code in region markers for easy identification and removal: