Eliot logging library is now open source!
I am happy to announce that Eliot, a logging library for Python, is now available as an open source project. In previous posts (now part of the documentation) I talked about the motivation behind Eliot: logging as storytelling. Log messages in Eliot are a forest of nested actions. Actions start and eventually finish, successfully or not. Log messages thus tell a story: what happened and what caused it.
Here’s what your logs might look like before using Eliot:
Going to validate http://example.com/index.html. Started download attempted. Download succeeded! Missing <title> element in "/html/body". Bad HTML entity in "/html/body/p[2]". 2 validation errors found!
After switching to Eliot you’ll get a tree of messages with both message contents and causal relationships encoded in a structured format:
{"action_type": "validate_page", "action_status": "started", "url": "http://example.com/index.html"} {"action_type": "download", "action_status": "started"} {"action_type": "download", "action_status": "succeeded"} {"action_type": "validate_html", "action_status": "started"} {"message_type": "validation_error", "error_type": "missing_title", "xpath": "/html/head"} {"message_type": "validation_error", "error_type": "bad_entity", "xpath": "/html/body/p[2]"} {"action_type": "validate_html", "action_status": "failed", "exception": "validator.ValidationFailed"} {"action_type": "validate_page", "action_status": "failed", "exception": "validator.ValidationFailed"}
To install:
$ pip install eliot
Documentation can be found on Read The Docs.
Bugs and feature requests should be filed at the project Github page.
More to read: Containers and distributed storage are the future