structlog v21.3.0 Release Notes

Release Date: 2021-11-20 // over 2 years ago
  • Backward-incompatible changes:

    • structlog switched its packaging to flit <https://flit.readthedocs.io/>_. Users shouldn't notice a difference, but (re-)packagers might.

    ๐Ÿ—„ Deprecations: ^

    none

    ๐Ÿ”„ Changes: ^

    • structlog.dev.ConsoleRenderer now has sort_keys boolean parameter that allows to disable the sorting of keys on output. #358 <https://github.com/hynek/structlog/pull/358>_
    • ๐Ÿ”ง structlog.processors.TimeStamper now works well with FreezeGun even when it gets applied before the loggers are configured. #364 <https://github.com/hynek/structlog/pull/364>_
    • ๐ŸŒฒ structlog.stdlib.AsyncBoundLogger now determines the running loop when logging, not on instantiation. That has a minor performance impact, but makes it more robust when loops change (e.g. aiohttp.web.run_app()), or you want to use sync_bl before a loop has started.
    • ๐Ÿ–จ structlog.stdlib.ProcessorFormatter now has a processors argument that allows to define a processor chain to run over all log entries.

    Before running the chain, two additional keys are added to the event dictionary: _record and _from_structlog. With them it's possible to extract information from logging.LogRecord\s and differentiate between structlog and logging log entries while processing them.

    The old processor (singular) parameter is now deprecated, but no plans exist to remove it. #365 <https://github.com/hynek/structlog/pull/365>_