Changelog History
Page 2
-
v18.2.0 Changes
September 05, 2018Backward-incompatible changes:
none
๐ Deprecations: ^
none
๐ Changes: ^
- ๐ฒ Added
structlog.stdlib.add_log_level_number()
processor that adds the level number to the event dictionary. Can be used to simplify log filtering.#151 <https://github.com/hynek/structlog/pull/151>
_ - 0๏ธโฃ
structlog.processors.JSONRenderer
now allows for overwriting the default argument of its serializer.#77 <https://github.com/hynek/structlog/pull/77>
,#163 <https://github.com/hynek/structlog/pull/163>
- โ Added
try_unbind()
that works likeunbind()
but doesn't raise aKeyError
if one of the keys is missing.#171 <https://github.com/hynek/structlog/pull/171>
_
- ๐ฒ Added
-
v18.1.0 Changes
January 27, 2018Backward-incompatible changes:
none
๐ Deprecations: ^
- The meaning of the
structlog[dev]
installation target will change from "colorful output" to "dependencies to developstructlog
" in 19.1.0.
The main reason behind this decision is that it's impossible to have a
structlog
in your normal dependencies and additionally astructlog[dev]
for development (pip
will report an error).๐ Changes: ^
- Empty strings are valid events now.
#110 <https://github.com/hynek/structlog/issues/110>
_ - Do not encapsulate Twisted failures twice with newer versions of Twisted.
#144 <https://github.com/hynek/structlog/issues/144>
_ - ๐ฎ
structlog.dev.ConsoleRenderer
now accepts a force_colors argument to output colored logs even if the destination is not a tty. Use this option if your logs are stored in files that are intended to be streamed to the console. structlog.dev.ConsoleRenderer
now accepts a level_styles argument for overriding the colors for individual levels, as well as to add new levels. See the docs forConsoleRenderer.get_default_level_styles()
for usage.#139 <https://github.com/hynek/structlog/pull/139>
_- ๐ป
structlog.stdlib.BoundLogger.exception()
now uses theexc_info
argument if it has been passed instead of setting it unconditionally toTrue
.#149 <https://github.com/hynek/structlog/pull/149>
_ - ๐ง Default configuration now uses plain
dict
\ s on Python 3.6+ and PyPy since they are ordered by default. - โ Added
structlog.is_configured()
to check whether or notstructlog
has been configured. - โ Added
structlog.get_config()
to introspect current configuration.
- The meaning of the
-
v17.2.0 Changes
May 15, 2017Backward-incompatible changes:
none
๐ Deprecations: ^
none
๐ Changes: ^
structlog.stdlib.ProcessorFormatter
now accepts keep_exc_info and keep_stack_info arguments to control what to do with this information on log records. Most likely you want them both to beFalse
therefore it's the default.#109 <https://github.com/hynek/structlog/issues/109>
_structlog.stdlib.add_logger_name()
now works instructlog.stdlib.ProcessorFormatter
'sforeign_pre_chain
.#112 <https://github.com/hynek/structlog/issues/112>
_- ๐ฒ Clear log record args in
structlog.stdlib.ProcessorFormatter
after rendering. This fix is for you if you tried to use it and gotTypeError: not all arguments converted during string formatting
exceptions.#116 <https://github.com/hynek/structlog/issues/116>
,#117 <https://github.com/hynek/structlog/issues/117>
-
v17.1.0 Changes
April 24, 2017๐ The main features of this release are massive improvements in standard library's
logging
integration. โก๏ธ Have a look at the updatedstandard library chapter <https://www.structlog.org/en/stable/standard-library.html>
_ on how to use them! Special thanks go toFabian 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>
, andsky-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 configurestructlog
. Colors are used if available and human-friendly timestamps are prepended. This is in line with our backwardcompatibility 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 uselogging
-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 runstructlog
processors on arbitrarylogging.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
andstructlog.dev.ConsoleRenderer
. This allows for human-readable non-ASCII output on Python 2 (repr()
on Python 2 behaves likeascii()
on Python 3 in that regard). As per compatibility policy, it's on (original behavior) inKeyValueRenderer
and off (humand-friendly behavior) inConsoleRenderer
.#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>
_
- ๐ง The default renderer now is
-
v16.1.0 Changes
May 24, 2016Backward-incompatible changes:
- ๐ Python 3.3 and 2.6 aren't supported anymore. They may work by chance but any effort to keep them working has ceased.
The last Python 2.6 release was on October 29, 2013 and isn't supported by the CPython core team anymore. Major Python packages like Django and Twisted dropped Python 2.6 a while ago already.
Python 3.3 never had a significant user base and wasn't part of any distribution's LTS release.
๐ Changes: ^
- โ Add a
drop_missing
argument toKeyValueRenderer
. Ifkey_order
is used and a key is missing a value, it's not rendered at all instead of being rendered asNone
.#67 <https://github.com/hynek/structlog/pull/67>
_ - Exceptions without a
__traceback__
are now also rendered on Python 3. - Don't cache loggers in lazy proxies returned from
get_logger()
. This lead to in-place mutation of them if used before configuration which in turn lead to the problem that configuration was applied only partially to them later.#72 <https://github.com/hynek/structlog/pull/72>
_
-
v16.0.0 Changes
January 28, 2016โ Added
- โ Added
structlog.dev.ConsoleRenderer
that renders the event dictionary aligned and with colors. - โ Added
structlog.processors.UnicodeDecoder
that will decode all byte string values in an event dictionary to Unicode. - โ Added
serializer
parameter tostructlog.processors.JSONRenderer
which allows for using different (possibly faster) JSON encoders than the standard library.
๐ Changed
structlog.processors.ExceptionPrettyPrinter
andstructlog.processors.format_exc_info
now support passing of Exceptions on Python 3.- six is now used for compatibility.
๐ Fixed
- โ Added
-
v15.3.0 Changes
September 25, 2015๐ Changes: ^
- Tolerate frames without a
__name__
, better.#58 <https://github.com/hynek/structlog/pull/58>
_ - ๐ Officially support Python 3.5.
- โ Add
structlog.ReturnLogger.failure
andstructlog.PrintLogger.failure
as preparation for the new Twisted logging system.
- Tolerate frames without a
-
v15.2.0 Changes
June 10, 2015๐ Changes: ^
- ๐ Allow empty lists of processors.
This is a valid use case since
#26 <https://github.com/hynek/structlog/issues/26>
_ has been merged. Before, supplying an empty list resulted in the defaults being used. - ๐ฒ Prevent Twisted's
log.err
from quoting strings rendered bystructlog.twisted.JSONRenderer
. - ๐ Better support of
logging.Logger.exception
withinstructlog
.#52 <https://github.com/hynek/structlog/pull/52>
_ - โ Add option to specify target key in
structlog.processors.TimeStamper
processor.#51 <https://github.com/hynek/structlog/pull/51>
_
- ๐ Allow empty lists of processors.
This is a valid use case since
-
v15.1.0 Changes
February 24, 2015๐ Fixed
- Tolerate frames without a
__name__
when guessing callsite names.
- Tolerate frames without a
-
v15.0.0 Changes
January 23, 2015๐ Changes: ^
- ๐ฒ Add
structlog.stdlib.add_log_level
andstructlog.stdlib.add_logger_name
processors.#44 <https://github.com/hynek/structlog/pull/44>
_ - โ Add
structlog.stdlib.BoundLogger.log
.#42 <https://github.com/hynek/structlog/pull/42>
_ - Pass positional arguments to stdlib wrapped loggers that use string formatting.
#19 <https://github.com/hynek/structlog/pull/19>
_ structlog
is now dually licensed under theApache License, Version 2 <https://choosealicense.com/licenses/apache/>
_ and theMIT <https://choosealicense.com/licenses/mit/>
_ license. Therefore it is now legal to use structlog withGPLv2 <https://choosealicense.com/licenses/gpl-2.0/>
-licensed projects.#28 <https://github.com/hynek/structlog/pull/28>
- โ Add
structlog.stdlib.BoundLogger.exception
.#22 <https://github.com/hynek/structlog/pull/22>
_
- ๐ฒ Add