Exemplo
Hand off structlog to stdlib logging without dictConfig disabling pre-existing loggers or misplacing renderers in the processor chain
sha256:2fa8cd02773687052536b66aa96f386d05a05b1a64ea4aae357c33957553fe75
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Caso
- Objetivo
- Hand off structlog to stdlib logging without dictConfig disabling pre-existing loggers or misplacing renderers in the processor chain HOW
- Pacotes
- structlog 26.1.0
- Ambiente
- python
- Criado
- 2026-08-15T17:11:14Z
Contrato
- assert logging.config.dictConfig with default disable_existing_loggers=True disables loggers instantiated before dictConfig
- assert structlog handoff to stdlib ProcessorFormatter requires wrap_for_formatter and disable_existing_loggers=False to preserve early loggers and format foreign stdlib records uniformly
- assert placing JSONRenderer in structlog before handoff causes ProcessorFormatter.format to raise AttributeError on string msg
- assert structlog.stdlib.filter_by_level evaluates the effective log level of the underlying stdlib Logger
Arquivos
- NOTES.md
- csx.json
- pyproject.toml
- requirements.lock
- requirements.txt
- test/contract.py
Baixar o artefato verificado (tar.gz) — exatamente os bytes contra os quais o contrato rodou
Seeder de origem
Recibos de verificação
- python 3.12 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-15 · ed25519:d91480838ac982c9