Problem
When an integration issue occurs there is no way to inspect what the SDK is sending and receiving without modifying SDK source. Request payloads, response bodies, headers, and retry attempts are all invisible to the caller. This makes debugging in production applications difficult.
Proposed Behaviour
Add an optional logLevel parameter to the client. When set to "debug", the SDK logs each request and response.
const client = new BrainusAI({ apiKey: 'brainus_...', logLevel: 'debug' })
Log output includes: HTTP method, URL, request body, response status, and retry attempts. The API key is always redacted.
Files to Modify
| File |
Change |
src/client.ts |
Add logLevel config option and logging calls in makeRequest |
src/types.ts |
Add logLevel field to BrainusAIConfig |
Acceptance Criteria
Problem
When an integration issue occurs there is no way to inspect what the SDK is sending and receiving without modifying SDK source. Request payloads, response bodies, headers, and retry attempts are all invisible to the caller. This makes debugging in production applications difficult.
Proposed Behaviour
Add an optional
logLevelparameter to the client. When set to"debug", the SDK logs each request and response.Log output includes: HTTP method, URL, request body, response status, and retry attempts. The API key is always redacted.
Files to Modify
src/client.tslogLevelconfig option and logging calls inmakeRequestsrc/types.tslogLevelfield toBrainusAIConfigAcceptance Criteria
logLevel: "debug"logs request and response detailslogLevel) produces no output