Structlog Standard Library Integration (structlog/stdlib.py)

structlog · src/structlog/stdlib.py · python · MIT
dev-tools, infra, lang:python

Provides processors and helpers to bridge Structlog with Python's standard logging module. Use this to maintain structured logging while supporting legacy logging configurations.

# Source: https://github.com/hynek/structlog | License: MIT | Copyright 2013 Hynek Schlawack and the structlog contributors
# Provided via justclaw.it.com; keep this notice with the code.
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the MIT License.  See the LICENSE file in the root of this
# repository for complete details.

"""
Processors and helpers specific to the :mod:`logging` module from the `Python
standard library <https://docs.python.org/>`_.

See also :doc:`structlog's standard library support <standard-library>`.
"""

from __future__ import annotations


__lazy_modules__ = ["asyncio", "threading", "warnings"]

import asyncio
import contextvars
import functools
import logging
import sys
import threading
import warnings

from collections.

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key