Changelog¶
Versions are year-based with a strict backward compatibility policy. The third digit is only for regressions.
16.0.0 (2016-01-28)¶
Changes:¶
structlog.processors.ExceptionPrettyPrinter
andstructlog.processors.format_exc_info
now support passing of Exceptions on Python 3.- Clean up the context when exiting
structlog.threadlocal.tmp_bind
in case of exceptions. [64] - Be more more lenient about missing
__name__
s. [62] - Add
structlog.dev.ConsoleRenderer
that renders the event dictionary aligned and with colors. - Use six for compatibility.
- Add
structlog.processors.UnicodeDecoder
that will decode all byte string values in an event dictionary to Unicode. - Add
serializer
parameter tostructlog.processors.JSONRenderer
which allows for using different (possibly faster) JSON encoders than the standard library.
15.3.0 (2015-09-25)¶
15.2.0 (2015-06-10)¶
Changes:¶
- Allow empty lists of processors. This is a valid use case since #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] - Add option to specify target key in
structlog.processors.TimeStamper
processor. [51]
15.0.0 (2015-01-23)¶
Changes:¶
- Add
structlog.stdlib.add_log_level
andstructlog.stdlib.add_logger_name
processors. [44] - Add
structlog.stdlib.BoundLogger.log
. [42] - Pass positional arguments to stdlib wrapped loggers that use string formatting. [19]
structlog
is now dually licensed under the Apache License, Version 2 and the MIT license. Therefore it is now legal to use structlog with GPLv2-licensed projects. [28]- Add
structlog.stdlib.BoundLogger.exception
. [22]
0.4.2 (2014-07-26)¶
Changes:¶
- Fixed a memory leak in greenlet code that emulates thread locals. It shouldn’t matter in practice unless you use multiple wrapped dicts within one program that is rather unlikely. [8]
structlog.PrintLogger
now is thread-safe.- Test Twisted-related code on Python 3 (with some caveats).
- Drop support for Python 3.2. There is no justification to add complexity for a Python version that nobody uses. If you are one of the 0.350% that use Python 3.2, please stick to the 0.4 branch; critical bugs will still be fixed.
- Officially support Python 3.4.
- Allow final processor to return a dictionary. See the adapting chapter. [26]
from structlog import *
works now (but you still shouldn’t use it).
0.4.1 (2013-12-19)¶
Changes:¶
- Don’t cache proxied methods in
structlog.threadlocal._ThreadLocalDictWrapper
. This doesn’t affect regular users. - Various doc fixes.
0.4.0 (2013-11-10)¶
Backward-incompatible changes:¶
Changes:¶
- Add
structlog.processors.StackInfoRenderer
for adding stack information to log entries without involving exceptions. Also added it to default processor chain. [6] - Allow optional positional arguments for
structlog.get_logger
that are passed to logger factories. The standard library factory uses this for explicit logger naming. [12] - Add
structlog.processors.ExceptionPrettyPrinter
for development and testing when multiline log entries aren’t just acceptable but even helpful. - Allow the standard library name guesser to ignore certain frame names. This is useful together with frameworks.
- Add meta data (e.g. function names, line numbers) extraction for wrapped stdlib loggers. [5]
0.3.0 (2013-09-23)¶
Changes:¶
- Greatly enhanced and polished the documentation and added a new theme based on Write The Docs, requests, and Flask.
- Add Python Standard Library-specific BoundLogger that has an explicit API instead of intercepting unknown method calls.
See
structlog.stdlib.BoundLogger
. structlog.ReturnLogger
now allows arbitrary positional and keyword arguments.- Add Twisted-specific BoundLogger that has an explicit API instead of intercepting unknown method calls.
See
structlog.twisted.BoundLogger
. - Allow logger proxies that are returned by
structlog.get_logger
andstructlog.wrap_logger
to cache the BoundLogger they assemble according to configuration on first use. See the chapter on performance and thecache_logger_on_first_use
argument ofstructlog.configure
andstructlog.wrap_logger
. - Extract a common base class for loggers that does nothing except keeping the context state.
This makes writing custom loggers much easier and more straight-forward.
See
structlog.BoundLoggerBase
.
0.2.0 (2013-09-17)¶
Changes:¶
- Promote to stable, thus henceforth a strict backward compatibility policy is put into effect.
- Add
key_order
option tostructlog.processors.KeyValueRenderer
for more predictable log entries with anydict
class. structlog.PrintLogger
now uses proper I/O routines and is thus viable not only for examples but also for production.- Enhance Twisted support by offering JSONification of non-structlog log entries.
- Allow for custom serialization in
structlog.twisted.JSONRenderer
without abusing__repr__
.
0.1.0 (2013-09-16)¶
Initial release.