Skip to content

Add request/response debug logging #13

Description

@codebestia

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.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions