• [Python-announce] structlog 21.3.0

    From Hynek Schlawack@hs@ox.cx to comp.lang.python.announce on Sat Nov 20 16:13:34 2021
    From Newsgroup: comp.lang.python.announce

    I’m happy to announce the release of structlog 21.3.0!
    With more than 2.5 million downloads per month, structlog is the most popular solution for structured logging in Python. It doesn’t just allow you to log key-value pairs in a structured manner, it also makes it EASIER and FASTER. Check out <https://www.structlog.org/en/stable/why.html> if you’re intrigued but not convinced!
    Heartfelt thanks go to my generous GitHub sponsors <https://github.com/sponsors/hynek>, companies subscribing on Tidelift <https://tidelift.com/subscription/pkg/pypi-structlog> (currently nobody :( – tell your boss!), and people who bought me a coffee on <https://ko-fi.com/the_hynek>!
    Support like that makes me work on FOSS on a Saturday afternoon, so please consider supporting me <https://hynek.me/say-thanks/> too! <3
    RELEASE HIGHLIGHTS:
    The main reason for this comparatively timely release is that aiohttp 3.8's new behavior of starting new loops within aiohttp.web.run_app() led to breakage in apps that use structlog.stdlib.AsyncBoundLogger.
    The one big new feature though is the support for much more powerful processor chains within structlog.stdlib.ProcessorFormatter. This took me way too long to get right, but I'm excited to share it with you.
    This is also the first release without a setup.py. Invoking it was never tested and never supported, so now it's gone. Please use standard packaging tools like PyPA's build <https://pypi.org/project/build/> or flit <https://flit.readthedocs.io/en/latest/> directly if you want to package structlog yourself.
    Full changelog:
    Backward-incompatible changes:
    - structlog switched its packaging to flit. 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
    - structlog.processors.TimeStamper now works well with FreezeGun even when it gets applied before the loggers are configured. #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.LogRecords 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
    --- Synchronet 3.19a-Linux NewsLink 1.113