chore(deps): update dependency structlog to v21.5.0 #89
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
==21.1.0
->==21.5.0
Release Notes
hynek/structlog
v21.5.0
Compare Source
Added
structlog.processors.LogfmtRenderer
processor to render log lines using the logfmt format.#376
structlog.stdlib.ExtraAdder
processor that adds extra attributes oflogging.LogRecord
objects to the event dictionary.This processor can be used for adding data passed in the
extra
parameter of thelogging
module's log methods to the event dictionary.#209,
#377
structlog.processor.CallsiteParameterAdder
processor that adds parameters of the callsite that an event dictionary originated from to the event dictionary.This processor can be used to enrich events dictionaries with information such as the function name, line number and filename that an event dictionary originated from.
#380
v21.4.0
Compare Source
Added
structlog.threadlocal.bound_threadlocal
andstructlog.contextvars.bound_contextvars
decorator/context managers to temporarily bind key-value pairs to a thread-local and context-local context.#371
Fixed
PYTHONOPTIMIZE=2
orpython -OO
).
#373
v21.3.0
Compare Source
Added
structlog.dev.ConsoleRenderer
now hassort_keys
boolean parameter that allows to disable the sorting of keys on output.#358
Changed
Users shouldn't notice a difference, but (re-)packagers might.
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 usesync_bl
before a loop has started.Fixed
structlog.processors.TimeStamper
now works well with FreezeGun even when it gets applied before the loggers are configured.#364
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 andlogging
log entries while processing them.The old processor (singular) parameter is now deprecated, but no plans exist to remove it.
#365
v21.2.0
Compare Source
Added
structlog.threadlocal.get_threadlocal()
andstructlog.contextvars.get_contextvars()
can now be used to get a copy of the current thread-local/context-local context that has been bound usingstructlog.threadlocal.bind_threadlocal()
andstructlog.contextvars.bind_contextvars()
.#331,
#337
structlog.threadlocal.get_merged_threadlocal(bl)
andstructlog.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 tocontextvars.Token
s, allowing you to reset values using the newstructlog.contextvars.reset_contextvars()
.#339
Exception rendering in
structlog.dev.ConsoleLogger
is now configurable using theexception_formatter
setting.If either the Rich or the better-exceptions package is present, structlog will use them for pretty-printing tracebacks.
Rich takes precedence over better-exceptions if both are present.
This only works if
format_exc_info
is absent in the processor chain.#330,
#349
The final processor can now return a
bytearray
(additionally tostr
andbytes
).#344
Changed
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 eitherrich
orbetter-exceptions
is installed), a warning will be raised and the exception will be rendered without prettification.All use of Colorama on non-Windows systems has been excised.
Thus, colors are now enabled by default in
structlog.dev.ConsoleRenderer
on non-Windows systems.You can keep using Colorama to customize colors, of course.
#345
Fixed
sys.stdout
isNone
(e.g. when running usingpythonw
). #313Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.