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 log_level parameter to the client. When set to "debug", the SDK logs each request and response through the standard Python logging module.
client = BrainusAI(log_level="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/brainus_ai/client.py |
Add log_level param and logging calls in _make_request |
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
log_levelparameter to the client. When set to"debug", the SDK logs each request and response through the standard Pythonloggingmodule.Log output includes: HTTP method, URL, request body, response status, and retry attempts. The API key is always redacted.
Files to Modify
src/brainus_ai/client.pylog_levelparam and logging calls in_make_requestAcceptance Criteria
log_level="debug"logs request and response detailslog_level) produces no outputloggingmodule, notprint