Skip to content

API Reference parrot.utils.http_logging

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.utils.http_logging

View source

Quiet the HTTP transport stacks the LLM SDKs log through.

httpx and httpcore trace every phase of every request at DEBUG::

[DEBUG] httpcore2.http11(_trace.py:85) :: send_request_headers.complete
[DEBUG] httpcore2.http11(_trace.py:85) :: receive_response_body.started

For a caller of an AI-Parrot client this is pure noise — one LLM call produces a dozen of these lines and none of them carries information the client's own logging does not already report.

Why the logger names are not just httpx/httpcore: the 2.x line of that stack ships under different top-level names — httpx2 and httpcore2 — and can be installed side by side with 1.x. In this workspace openai requires httpx2<3,>=2.7.0 while anthropic and groq still require httpx<1, so BOTH stacks are live in one process. That is why the long-standing logging.getLogger("httpcore").setLevel(WARNING) lines around the codebase never silenced the OpenAI-protocol clients — and those include :class:~parrot.clients.amazon.nova.mantle.BedrockMantleClient, which reaches AWS Bedrock over Bedrock Mantle's OpenAI-compatible endpoint via the OpenAI SDK. Its transport logs as httpcore2, so the httpcore rule missed it entirely.

Override via PARROT_HTTP_LOG_LEVEL (e.g. DEBUG to restore the full wire trace while debugging a connection problem, or a numeric level).

Attribute HTTP_LOGGER_NAMES

Type: tuple[str, ...]

Function quiet_http_loggers

Raise the httpx/httpcore logger families to WARNING. Idempotent.

Setting a level on a logger by name works whether or not that logger (or the library behind it) exists yet — loggers are singletons created on first getLogger — so this is safe to call at import time, before the SDK that will do the logging has been imported, and safe to call again later to re-assert the level after an application reconfigures logging.

quiet_http_loggers(level: int | str | None = None) -> None

Parameter Type Default Description
level int | str | None None Explicit level (int or name) to apply. When None, the PARROT_HTTP_LOG_LEVEL environment variable is consulted and WARNING is used if it is unset.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally