- Python versions older than 3.5.3, e.g. the 3.5.2 on Ubuntu Xenial, don’t work with Eliot, so added a more informative error message explaining that. Fixes #418.
- If you call
to_file()/FileDestination()with a non-writable file, an exception will be raised. This prevents logging from being silently swallowed when the program runs. Fixes #403.
- PyPy3 is now officially supported.
- If you log a NumPy array whose size > 10000, only a subset will logged. This is to ensure logging giant arrays by mistake doesn’t impact your software’s performance. If you want to customize logging of large arrays, see Logging large arrays. Fixes #410.
- Eliot now supports Trio coroutines, as well as other frameworks that utilize Python 3.7’s
contextvars(Python 3.5 and 3.6 are also supported, using backport packages).
eliot.use_asyncio_context()is no longer necessary. On Python 3.5 and 3.6, however, you should make sure to import
aiocontextvars) before you start your first event loop.
- Python 2.7 is now in legacy support mode; the last major Eliot release supporting it is 1.7.0. See Python 2.7 Support for details.
- Python 3.4 is no longer supported.
- Eliot has an API for testing that your logs were output correctly. Until now, however, the documentation was overly focused on requiring usage of types, which are optional, so it has been rewritten to be more generic: read more about the testing API here.
- Generating messages is much faster.
- Eliot now works with PyInstaller. Thanks to Jean-Paul Calderone for the bug report. Fixes issue #386.
- The testing infrastructure now has slightly more informative error messages. Thanks to Jean-Paul Calderone for the bug report. Fixes issue #373.
- Added lower-level testing infrastructure—
eliot.testing.check_for_errors—which is useful for cases when the
@capture_loggingdecorator is insufficient. For example, test methods that are async, or return Twisted
Deferred. See the testing documentation for details. Thanks to Jean-Paul Calderone for the feature request. Fixes #364.
eliot.ValidationError, as raised by e.g.
capture_logging, is now part of the public API. Fixed issue #146.
- New decorator,
@eliot.twisted.inline_callbacks, which is like Twisted’s
inlineCallbacksbut which also manages the Eliot context. Thanks to Jean-Paul Calderone for the fix. Fixed issue #259.
eliot.twisted.DeferredContext.addCallbacksnow supports omitting the errback, for compatibility with Twisted’s
Deferred. Thanks to Jean-Paul Calderone for the fix. Fixed issue #366.
- Fixed bug in the
asynciocoroutine support where only the thread where
use_asyncio_context()was called supported coroutine-specific contexts. Fixes issue #388.
ILogger.writeis now explicitly thread-safe. The
MemoryLogger(as used by tests) implementation of this method which was previously not thread-safe is now thread-safe. Thanks to Jean-Paul Calderone for the patch. Fixes issue #382.
- Python 2 is still supported, but will be dropped in one of the next releases. See Python 2.7 Support.
- NumPy integers, floats, bools and arrays are now automatically serialized to JSON, via a new default JSON encoder (
- Dask support: replace
eliot.dask.compute_with_trace()to automatically preserve Eliot context for
DelayedDask computations. See Using Dask for details.
- New decorator,
@eliot.log_call, which automatically creates an action that starts when function is called and ends when it returns. See Logging Functions.
- A parser library for parsing serialized Eliot JSON messages into a tree of Python objects. See Parsing Logs for details.
eliot.testing.LoggedActionhas a new method,
type_tree(), that returns the tree of action and message types. This allows for easier testing of action structure.
eliot.testing.LoggedAction.of_typenow accepts the type as a string, not just an
LoggedMessage.of_typealso accepts the type as a string.
- The standard library
loggingbridge now logs tracebacks, not just messages.
- You can now pass in an explicit traceback tuple to
- The deprecated
writeFailurehas been removed.
- Added support for routing standard library logging into Eliot; see Route existing logs to Eliot for details.
- Added support for Python 3.7.
Output format changes:
- All messages now have either
- Documented how to add log levels, and how to filter Eliot logs.
- Logstash configuration is closer to modern version’s options, though still untested.
- Explained how to integrate/migrate existing logging with Eliot.
- The default JSON output format now supports custom JSON encoders. See Customizing JSON Encoding for details. Thanks to Jonathan Jacobs for feedback.
MemoryLogger.validate()now gives more informative errors if JSON encoding fails. Thanks to Jean-Paul Calderone for the bug report.
- On Python 3, the JSON encoder used by
bytes… sometimes. This is deprecated, and will cease to work in a future release of Eliot (on Python 3, it will continue to work on Python 2). If you wish to include
bytesin JSON logging, convert it to a string in the log-generating code, use Eliot’s type system, or use a custom JSON encoder.
- Eliot now does the right thing for
asynciocoroutines in Python 3.5 and later. See Asyncio/Trio Coroutine Support for details. Thanks to x0zzz for the bug report.
Action.continue_taskcan now accept text task IDs (
strin Python 3,
unicodein Python 2).
- Messages are no longer lost if they are logged before any destinations are added. In particular, messages will be buffered in memory until the first set of destinations are added, at which point those messages will be delivered. Thanks to Jean-Paul Calderone for the feature request.
eliot.add_destination, and accepts multiple Destinations at once.
eliot.twisted.TwistedDestinationallows redirecting Eliot logs to
twisted.logger. Thanks to Glyph Lefkowitz for the feature request.
- Coding standard switched to PEP-8.
- Dropped support for Python 3.3.
- Dropped support for versions of Twisted older than 15.2 (or whenever it was that
- Dropped support for
Eliot is stable, and has been for a while, so switching to v1.0.
- New API:
MessageType.log(), the equivalent of
Message.log(), allows you to quickly create a new typed log message and write it out.
- New APIs:
eliot.current_action()returns the current
Action.task_uuidis the task’s UUID.
- You can now do
with YOUR_ACTION().context() as action:, i.e.
Action.context()context manager returns the
ActionType.as_taskno longer requires a logger argument, matching the other APIs where passing in a logger is optional.
- Python 3.6 support.
- Made test suite pass again with latest Hypothesis release.
- Eliot tasks can now more easily span multiple threads using the new
eliot-prettyprintcommand line tool now pretty prints field values in a more informative manner.
eliot-prettyprintnow handles unparseable lines by skipping formatting them rather than exiting.
- Fixed regression in 0.10.0: fix validation of failed actions and tracebacks with extracted additional fields.
register_exception_extractorallows for more useful logging of failed actions and tracebacks by extracting additional fields from exceptions.
- Python 3.5 support.
- Journald support works on Python 3.
- Native journald support.
eliot-prettyprintis a command-line tool that formats JSON Eliot messages into a more human-friendly format.
eliot.logwriter.ThreadedWriteris a Twisted non-blocking wrapper for any blocking destination.
Message.logwill log a new message, combining the existing
writeFailureno longer require a
Logger; they now default to using the global one.
- The logs written with
redirectLogsForTrialare now written in JSON format, rather than with
FileDestinationwill now call
flush()on the given file object after writing the log message. Previously log messages would not end up being written out until the file buffer filled up.
Messagelogged outside the context of an action now gets a unique
- Creating your own
Loggerinstances is no longer necessary; all relevant APIs now default to using a global one. A new testing decorator (
eliot.testing.capture_logging) was added to capture global logging.
- Support positional
Field-instance arguments to
fields()to make combining existing field types and simple fields more convenient. Contributed by Jonathan Jacobs.
writeFailureno longer require a
systemargument, as the combination of traceback and action context should suffice to discover the origin of the problem. This is a minor change to output format as the field is also omitted from the resulting
validate_loggingtesting utility now skips validation when the decorated test method raises
- Exceptions in destinations are now handled better: instead of being dropped silently an attempt is made to log a message about the problem. If that also fails then the exception is dropped.
Incompatible output format change! In previous versions the ordering of messages and actions was ambiguous and could not be deduced from out-of-order logs, and even where it was possible sorting correctly was difficult.
To fix this the
action_counter field was removed and now all messages can be uniquely located within a specific task by the values in an improved task_level field.
- Eliot tasks can now span multiple processes and threads, allowing for easy tracing of actions in complex and distributed applications.
- eliot.add_global_fields allows adding fields with specific values to all Eliot messages logged by your program. This can be used to e.g. distinguish between log messages from different processes by including relevant identifying information.
- On Python 3 files that accept unicode (e.g.
sys.stdout) should now work.
- Added support for Python 3.4.
- Most public methods and functions now have underscore-based equivalents to the camel case versions, e.g.
eliot.writeTraceback, for use in PEP 8 styled programs. Twisted-facing APIs and pyunit assertions do not provide these additional APIs, as camel-case is the native idiom.
eliot.to_fileoutputs log messages to a file.
- Documented how to load Eliot logging into ElasticSearch via Logstash.
- Documentation has been significantly reorganized.
Note that this is the last release that will make incompatible API changes without interim deprecation warnings.
Incompatible changes from 0.3.0:
Loggerno longer does JSON serialization; it’s up to destinations to decide how to serialize the dictionaries they receive.
- Timestamps are no longer encoded in TAI64N format; they are now provided as seconds since the Unix epoch.
ActionTypeno longer supports defining additional failure fields, and therefore accepts one argument less.
Action.finishAfterhave been removed, as they are replaced by
- Added a simpler API (
fields()) for defining fields for
- Added support for Python 3.3.
- Actions can now be explicitly finished using a public API:
Action.context()context manager allows setting an action context without finishing the action when exiting the block.
- Added a new API for Twisted
eliot.twisted.redirectLogsForTrialwill redirect Eliot logs to Twisted’s logs when running under the