Debug Log Server
Use this skill when a repo has been set up with the debug log server files from this package, or when the user wants to add them with the installed manual setup prompt.
Setup
If the repo does not already contain debug-log-server/ and src/utils/debug-log/, ask the user to run:
aipm show-prompt @aipm/debug-log-server
Then they should paste that prompt into their AI coding tool from the target repo root. The setup prompt installs the helper templates, adds package scripts, and keeps all setup execution manual.
Daily Workflow
- Start the collector:
npm run debug:server
- Reset the poll baseline before reproducing the issue:
npm run debug:poll -- --reset-baseline
Add focused instrumentation around the suspected flow with
sendDebugLog(...)in browser/client code orsendDebugLogNode(...)in Node code.Reproduce the issue in the app.
Poll new logs:
npm run debug:poll -- --once
- Wait for a specific event when validating a fix:
npm run debug:poll -- --wait-for event-name --timeout 15000
- Analyze the latest session:
npm run debug:analyze
Event Shape
Send compact, structured entries:
sendDebugLog({
source: "dashboard",
event: "dashboard:init:start",
level: "info",
step: "load-user-profile",
durationMs: 42,
detail: { route: "/dashboard" },
});
Common fields are source, event, level, name, durationMs, step, route, method, url, status, tag, message, and detail.
Safety Rules
- Use this only in development.
- Do not log tokens, cookies, passwords, secrets, customer PII, or full request/response bodies.
- Prefer stable event names and small structured details.
- Remove temporary instrumentation when the issue is solved.
- The collector is intentionally unauthenticated and should bind only to trusted local or development-network use.