Overview

Request 925035 accepted

- Update to 21.2.0:
Highlights:
* Support for for beautiful (and helpful!) exceptions by integrating
ConsoleRenderer with rich or better-exceptions.
* Helpers to access thread-local and context-local context.
* Deeper contextvars support.
Backward-incompatible changes:
* To implement pretty exceptions (see Changes below),
structlog.dev.ConsoleRenderer now formats exceptions itself.
Make sure to remove format_exc_info from your processor chain if you
configure structlog manually. This change is not really breaking
because the old use-case will keep working as before. However if
you pass pretty_exceptions=True (which is the default if either
rich or better-exceptions is installed), a warning will be raised
and the exception will be renderered without prettyfication.
Changes:
* structlog is now importable if sys.stdout is None (e.g. when
running using pythonw). #313
* structlog.threadlocal.get_threadlocal() and
structlog.contextvars.get_contextvars() can now be used to get a copy
of the current thread-local/context-local context that has been bound
using structlog.threadlocal.bind_threadlocal() and
structlog.contextvars.bind_contextvars(). #331 #337
* structlog.threadlocal.get_merged_threadlocal(bl) and
structlog.contextvars.get_merged_contextvars(bl) do the same, but
also merge the context from a bound logger bl. Same pull requests as
previous change.
* structlog.contextvars.bind_contextvars() now returns a mapping of
keys to contextvars.Tokens, allowing you to reset values using the
new structlog.contextvars.reset_contextvars(). #339

Request History
Michael Vetter's avatar

jubalh created request

- Update to 21.2.0:
Highlights:
* Support for for beautiful (and helpful!) exceptions by integrating
ConsoleRenderer with rich or better-exceptions.
* Helpers to access thread-local and context-local context.
* Deeper contextvars support.
Backward-incompatible changes:
* To implement pretty exceptions (see Changes below),
structlog.dev.ConsoleRenderer now formats exceptions itself.
Make sure to remove format_exc_info from your processor chain if you
configure structlog manually. This change is not really breaking
because the old use-case will keep working as before. However if
you pass pretty_exceptions=True (which is the default if either
rich or better-exceptions is installed), a warning will be raised
and the exception will be renderered without prettyfication.
Changes:
* structlog is now importable if sys.stdout is None (e.g. when
running using pythonw). #313
* structlog.threadlocal.get_threadlocal() and
structlog.contextvars.get_contextvars() can now be used to get a copy
of the current thread-local/context-local context that has been bound
using structlog.threadlocal.bind_threadlocal() and
structlog.contextvars.bind_contextvars(). #331 #337
* structlog.threadlocal.get_merged_threadlocal(bl) and
structlog.contextvars.get_merged_contextvars(bl) do the same, but
also merge the context from a bound logger bl. Same pull requests as
previous change.
* structlog.contextvars.bind_contextvars() now returns a mapping of
keys to contextvars.Tokens, allowing you to reset values using the
new structlog.contextvars.reset_contextvars(). #339


Dirk Mueller's avatar

dirkmueller accepted request

openSUSE Build Service is sponsored by