Skip to content

API Reference parrot.utils.log_levels

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

parrot.utils.log_levels

View source

Resolve a logging level from a name, a number, or an environment string.

Shared by the quiet_* helpers in :mod:parrot.utils.faiss_logging and :mod:parrot.utils.http_logging, which all expose the same escape hatch: a library's chatter is raised to WARNING by default, and an environment variable puts it back ("DEBUG", "INFO", or a numeric level).

Function resolve_log_level

Resolve a level name ("DEBUG") or numeric string to a level int.

resolve_log_level(raw: str | None, default: int) -> int

Parameter Type Default Description
raw str | None Level name, numeric string, None, or an empty/blank string.
default int Level returned when raw is missing, blank, or not a level Python's logging module recognises.

Returns: int — The resolved integer logging level.

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