Skip to content

Restore --debug request/response logging (needs SDK logging support) #33

@zfarrell

Description

@zfarrell

Regression from the SDK refactor. --debug used to log every API request/response (the old ApiClient routed all calls through util::send_debug). Now it only logs the raw-HTTP/auth paths that still call send_debug (PKCE/token mints in jwt.rs, session mints, the /files upload, skill/update downloads) — the main API traffic is silent: the seam's raw helpers don't log, and SDK-typed calls can't be logged from the CLI (the SDK has zero log:: calls and exposes no request hook; reqwest has no logging middleware hook).

Fix belongs in the SDK, not a CLI workaround (per project preference — keep the CLI a thin consumer; a CLI-side raw-helper hack would only cover some commands and leave SDK-typed ones silent and inconsistent). Plan:

sdk-rust (prerequisite): add request/response debug logging that covers ALL ops — generated free functions AND the ergonomic methods (submit_query/upload_stream/resource handles). Likely a generator option/template change so generated ops emit log::debug! (method, url, redacted headers, body) + response (status, body), plus matching logs in the hand-written layer. MUST redact Authorization bearer tokens and sensitive bodies (e.g. secrets) — mirror the CLI's existing mask_credential/redaction. Validate any template change with the generator + a compile check.

hotdata-cli: when --debug is set, wire a log backend (e.g. env_logger or a small custom logger) at the SDK's target/debug level, formatted close to the old >>> METHOD url / <<< status / body output. Then --debug covers SDK-typed + raw + auth paths uniformly.

Until this lands, --debug only surfaces the auth/upload paths. Surfaced during the SDK refactor (PR hotdata-dev/hotdata-cli#134).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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