>> log.info("Hello %s! The answer is %d.", "World", 42, x=1) 2022-10-07 10:04.31 [info ] Hello World! The answer is 42. x=1 #454 FilteringBoundLogger now also has support for asyncio-based logging. Instead of a wrapper class like structlog.stdlib.AsyncBoundLogger, async equivalents have been added for all logging methods. So instead of log.info("hello") you can also write await log.ainfo("hello") in async functions and methods. This seems like the better approach and if it's liked by the community, structlog.stdlib.BoundLogger will get those methods too. #457 Changed The documentation has been heavily overhauled. Have a look if you haven't lately! Especially the graphs in the standard library chapter have proven valuable to many. The build backend has been switched to Hatch. Fixed The timestamps in the default configuration now use the correct separator (:) for seconds. v22.1.0 Compare Source Removed Python 3.6 is not supported anymore. Pickling is now only possible with protocol version 3 and newer. Deprecated The entire structlog.threadlocal module is deprecated. Please use the primitives from structlog.contextvars instead. If you're using the modern APIs (bind_threadlocal() / merge_threadlocal()) it's enough to replace them 1:1 with their contextvars counterparts. The old approach around wrap_dict() has been discouraged for a while. Currently there are no concrete plans to remove the module, but no patches against it will be accepted from now on. #409 Added structlog.processors.StackInfoRenderer now has an additional_ignores parameter that allows you to filter out your own logging layer. #396 Added structlog.WriteLogger, a faster – but more low-level – alternative to structlog.PrintLogger. It works the way PrintLogger used to work in previous versions. #403 #404 structlog.make_filtering_bound_logger()-returned loggers now also have a log() method to match the structlog.stdlib.BoundLogger signature closer. #413 Added structured logging of tracebacks via the structlog.tracebacks module, and most notably the structlog.tracebacks.ExceptionDictTransformer which can be used with the new structlog.processors.ExceptionRenderer to render JSON tracebacks. #407 structlog.stdlib.recreate_defaults(log_level=logging.NOTSET) that recreates structlog's defaults on top of standard library's logging. It optionally also configures logging to log to standard out at the passed log level. #428 structlog.processors.EventRenamer allows you to rename the hitherto hard-coded event dict key event to something else. Optionally, you can rename another key to event at the same time, too. So adding EventRenamer(to="msg", replace_by="_event") to your processor pipeline will rename the standard event key to msg and then rename the _event key to event. This allows you to use the event key in your own log files and to have consistent log message keys across languages. structlog.dev.ConsoleRenderer(event_key="event") now allows to customize the name of the key that is used for the log message. Changed structlog.make_filtering_bound_logger() now returns a method with the same signature for all log levels, whether they are active or not. This ensures that invalid calls to inactive log levels are caught immediately and don't explode once the log level changes. #401 structlog.PrintLogger – that is used by default – now uses print() for printing, making it a better citizen for interactive terminal applications. #399 structlog.testing.capture_logs now works for already initialized bound loggers. #408 structlog.processors.format_exc_info() is no longer a function, but an instance of structlog.processors.ExceptionRenderer. Its behavior has not changed. #407 The default configuration now includes the structlog.contextvars.merge_contextvars processor. That means you can use structlog.contextvars features without configuring structlog. Fixed Overloaded the bind, unbind, try_unbind and new methods in the FilteringBoundLogger Protocol. This makes it easier to use objects of type FilteringBoundLogger in a typed context. #392 Monkeypatched sys.stdouts are now handled more gracefully by ConsoleRenderer (that's used by default). #404 structlog.stdlib.render_to_log_kwargs() now correctly handles the presence of exc_info, stack_info, and stackLevel in the event dictionary. They are transformed into proper keyword arguments instead of putting them into the extra dictionary. #424, #427 v21.5.0 Compare Source Added Added the structlog.processors.LogfmtRenderer processor to render log lines using the logfmt format. #376 Added the structlog.stdlib.ExtraAdder processor that adds extra attributes of logging.LogRecord objects to the event dictionary. This processor can be used for adding data passed in the extra parameter of the logging module's log methods to the event dictionary. #209, #377 Added the 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 Added the structlog.threadlocal.bound_threadlocal and structlog.contextvars.bound_contextvars decorator/context managers to temporarily bind key-value pairs to a thread-local and context-local context. #371 Fixed Fixed import when running in optimized mode (PYTHONOPTIMIZE=2 or python -OO) . #373 v21.3.0 Compare Source Added structlog.dev.ConsoleRenderer now has sort_keys boolean parameter that allows to disable the sorting of keys on output. #358 Changed structlog switched its packaging to flit. 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 (for example, aiohttp.web.run_app()), or you want to use sync_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.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 v21.2.0 Compare Source Added 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 Exception rendering in structlog.dev.ConsoleLogger is now configurable using the exception_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 to str and bytes). #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 either rich or better-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 structlog is now importable if sys.stdout is None (for example, when running using pythonw). #313 Configuration 📅 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: Never, or you tick the rebase/retry checkbox. 🔕 Ignore: Close this PR and you won't be reminded about this update again. If you want to rebase/retry this PR, check this box This PR was generated by Mend Renovate. View the repository job log.">
chore(deps): update dependency structlog to v25 #217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
chore(deps): update dependency structlog to v25 #217
Changes from all commits
28be952
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing