Description
When debugging integration issues, developers need visibility into what the SDK is sending and receiving. A debug mode should log outgoing requests (method, URL, headers, body) and incoming responses (status, headers, body), with sensitive values masked.
Proposed Steps
- Add
debug: bool = False to ShadeClient and global config.
- When
debug=True, emit structured logs via Python's logging module under the shade logger.
- Mask
Authorization header value in logs (show only last 4 characters).
- Truncate response bodies longer than 2000 characters with a
[truncated] suffix.
Acceptance Criteria
- With
debug=True, each request logs method, URL, and masked headers.
- Each response logs status code and truncated body.
- Authorization header value is always masked in logs.
- With
debug=False (default), no request/response content is logged.
- Logs use
logging.DEBUG level so they don't appear unless the app enables them.
Description
When debugging integration issues, developers need visibility into what the SDK is sending and receiving. A debug mode should log outgoing requests (method, URL, headers, body) and incoming responses (status, headers, body), with sensitive values masked.
Proposed Steps
debug: bool = FalsetoShadeClientand global config.debug=True, emit structured logs via Python'sloggingmodule under theshadelogger.Authorizationheader value in logs (show only last 4 characters).[truncated]suffix.Acceptance Criteria
debug=True, each request logs method, URL, and masked headers.debug=False(default), no request/response content is logged.logging.DEBUGlevel so they don't appear unless the app enables them.