vgi.logging_config
Module overview
Shared logging configuration for VGI worker CLIs.
Provides enums, known-logger registry, and a configure function that
mirrors the vgi_rpc CLI logging setup so that --debug, --log-level,
--log-logger, and --log-format behave identically across all
VGI workers.
function configure_worker_logging
Section titled “function configure_worker_logging”configure_worker_logging(
*,
debug: bool = False,
log_level: LogLevel = LogLevel.INFO,
log_loggers: list[str] | None = None,
log_format: LogFormat = LogFormat.text,
access_log_sample: float | None = None,
access_log_async: bool = False,
access_log_queue_size: int | None = None,
) -> int
Configure stdlib logging for a VGI worker process.
VGI_WORKER_LOG_LEVEL, VGI_WORKER_LOG_FORMAT and
VGI_WORKER_LOG_LOGGERS override the corresponding arguments when set —
see :func:_env_overrides. The access-log arguments have their own
VGI_WORKER_ACCESS_LOG_* overrides; see :func:_access_log_overrides.
Sampling and async emission apply only to vgi_rpc.access, and only when
that logger is among the configured targets. They are deliberately not
applied to the diagnostic loggers: dropping half of a traceback is not a
saving.
Trace correlation needs no configuration here — vgi_rpc reads whatever span
is current when it emits a record, so trace_id / span_id appear on
every record as soon as OpenTelemetry is active (VGI_OTEL_ENABLED=1).
class LogFormat
Section titled “class LogFormat”Bases: StrEnum
Description
Stderr log format for --log-format.
Attributes
attribute text
Section titled “attribute text”attribute json
Section titled “attribute json”class LogLevel
Section titled “class LogLevel”Bases: StrEnum
Description
Python logging level for --log-level.
Attributes