Skip to content

Add --debug flag to log API requests and retries - #96

Open
kritikmodi wants to merge 5 commits into
prooflinedev:mainfrom
kritikmodi:debug-logging
Open

kritikmodi wants to merge 5 commits into
prooflinedev:mainfrom
kritikmodi:debug-logging

Conversation

@kritikmodi

Copy link
Copy Markdown

Description

  • Adds a --debug flag (or PROOFLINE_DEBUG=1) that prints each API and MCP request to stderr: method, path, status, timing and any retries.
  • It helps when a command fails with a bare "HTTP 500" or seems to hang while it waits to retry.
  • Headers and request/response bodies are never printed, so tokens and code stay out of the logs.
  • Stdout is unchanged, so --json and the MCP bridge still work as before.

Example

Here's an example of what a simple debug text would look like:

proofline debug: → GET /api/v1/organizations/…/reviews?limit=50
proofline debug: ← 503 in 2 ms (0 bytes)
proofline debug: retry 1 of 3 in 1 s

Testing

Tested with fmt, clippy, the test suite (including the new tests/debug.rs) and by hand against a local server: errors, retries, timeouts and MCP calls.

@kritikmodi

Copy link
Copy Markdown
Author

Hi @mohsen1!

While using the CLI I realized there's no debug logging, so thought this could be a good addition. This PR adds a debug mode for when a command fails or stalls and the error doesn't say enough to tell why. Can you please review this? Thanks!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant