Skip to content

Conversation

gastonmorixe
Copy link

@gastonmorixe gastonmorixe commented Aug 20, 2025

Important

Disclaimer: I vibe-coded this logging feature with codex-cli and claude code. I'm not a python expert at all. This should be carefully reviewed.

asciicast

  • CLI: add --http-logging and --http-debug flags (env: LLM_HTTP_LOGGING, LLM_HTTP_DEBUG) and early initialization via configure_http_logging().
  • Implement universal HTTP logging (color formatter, config detection, logging setup); include 'format' in _get_http_logging_config for tests; support NO_COLOR.
  • Tests: add unit and integration tests for HTTP logging configuration and CLI help.

@gastonmorixe gastonmorixe force-pushed the gm/feature/logging branch 2 times, most recently from f4b6bd7 to 85db9b6 Compare August 20, 2025 23:04
- CLI: add --http-logging and --http-debug flags (env: LLM_HTTP_LOGGING, LLM_HTTP_DEBUG) and early initialization via configure_http_logging().
- utils: implement universal HTTP logging (color formatter, config detection, logging setup); include 'format' in _get_http_logging_config for tests; support NO_COLOR.
- Tests: add unit and integration tests for HTTP logging configuration and CLI help.
- Ignore build/ and dist/ in .gitignore; remove stray build/ artifact.
- Add docs page docs/http-debugging.md with Quick Start, env vars, CLI flags and guidance; link from docs/logging.md and include in main TOC.
- Regenerate docs/help.md and README to include new flags and navigation.
@gastonmorixe
Copy link
Author

image

gastonmorixe and others added 2 commits August 20, 2025 21:42
The user-facing documentation for the new universal HTTP logging feature was split across `UNIVERSAL-HTTP-LOGGING.md` and `docs/http-debugging.md`.

This commit consolidates all the relevant user-facing documentation into `docs/http-debugging.md` and removes the now redundant `UNIVERSAL-HTTP-LOGGING.md` file, which contained mostly implementation details.
@gastonmorixe
Copy link
Author

@codex review please and give your thoughts / suggestions

@gastonmorixe
Copy link
Author

@codex can you review please?

The loop that attaches handlers only runs when logger.handlers is empty. The OpenAI SDK (and some others) ship their loggers with a logging.NullHandler pre‑attached, so this condition is false and your code never replaces the NullHandler. As a result, even after --http-logging the OpenAI logger still drops all messages and nothing is emitted. To make the feature actually show provider logs, the setup should detect and replace existing NullHandlers (or always add your stream handler) instead of skipping loggers that already have a handler.

Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
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