structlog v17.1.0 Release Notes

Release Date: 2017-04-24 // almost 7 years ago
  • 🚀 The main features of this release are massive improvements in standard library's logging integration. ⚡️ Have a look at the updated standard library chapter <https://www.structlog.org/en/stable/standard-library.html>_ on how to use them! Special thanks go to Fabian Büchler <https://github.com/fabianbuechler>, Gilbert Gilb's <https://github.com/gilbsgilbs>, Iva Kaneva <https://github.com/if-fi>, insolite <https://github.com/insolite>, and sky-code <https://github.com/sky-code>_, that made them possible.

    Backward-incompatible changes:

    • 🔧 The default renderer now is structlog.dev.ConsoleRenderer if you don't configure structlog. Colors are used if available and human-friendly timestamps are prepended. This is in line with our backward compatibility policy <https://www.structlog.org/en/stable/backward-compatibility.html>_ that explicitly excludes default settings.

    🔄 Changes: ^

    • Added structlog.stdlib.render_to_log_kwargs(). This allows you to use logging-based formatters to take care of rendering your entries. #98 <https://github.com/hynek/structlog/issues/98>_
    • ➕ Added structlog.stdlib.ProcessorFormatter which does the opposite: This allows you to run structlog processors on arbitrary logging.LogRecords. #79 <https://github.com/hynek/structlog/issues/79>, #105 <https://github.com/hynek/structlog/issues/105>
    • UNIX epoch timestamps from structlog.processors.TimeStamper are more precise now.
    • Added repr_native_str to structlog.processors.KeyValueRenderer and structlog.dev.ConsoleRenderer. This allows for human-readable non-ASCII output on Python 2 (repr() on Python 2 behaves like ascii() on Python 3 in that regard). As per compatibility policy, it's on (original behavior) in KeyValueRenderer and off (humand-friendly behavior) in ConsoleRenderer. #94 <https://github.com/hynek/structlog/issues/94>_
    • Added colors argument to structlog.dev.ConsoleRenderer and made it the default renderer. #78 <https://github.com/hynek/structlog/pull/78>_
    • 🛠 Fixed bug with Python 3 and structlog.stdlib.BoundLogger.log(). Error log level was not reproductible and was logged as exception one time out of two. #92 <https://github.com/hynek/structlog/pull/92>_
    • 🚚 Positional arguments are now removed even if they are empty. #82 <https://github.com/hynek/structlog/pull/82>_