Skip to main content

eliottree

build coverage

Render Eliot logs as an ASCII tree.

This output:

$ eliot-tree eliot.log
f3a32bb3-ea6b-457c-aa99-08a3d0491ab4
└── app:soap:client:request/1 ⇒ started
    ├── dump: /home/user/dump_files/20150303/1425356936.28_Client_req.xml
    ├── soapAction: a_soap_action
    ├── timestamp: 2015-03-03 04:28:56.278875
    ├── uri: http://example.org/soap
    ├── app:soap:client:success/2/1 ⇒ started
    │   ├── timestamp: 2015-03-03 04:28:57.516579
    │   └── app:soap:client:success/2/2 ⇒ succeeded
    │       ├── dump: /home/user/dump_files/20150303/1425356937.52_Client_res.xml
    │       └── timestamp: 2015-03-03 04:28:57.517077
    └── app:soap:client:request/3 ⇒ succeeded
        ├── status: 200
        └── timestamp: 2015-03-03 04:28:57.517161

89a56df5-d808-4a7c-8526-e603aae2e2f2
└── app:soap:service:request/1 ⇒ started
    ├── dump: /home/user/dump_files/20150303/1425357068.03_Service_req.xml
    ├── soapAction: method
    ├── timestamp: 2015-03-03 04:31:08.032091
    ├── uri: /endpoints/soap/method
    ├── app:soap:service:success/2/1 ⇒ started
    │   ├── timestamp: 2015-03-03 04:31:11.512330
    │   └── app:soap:service:success/2/2 ⇒ succeeded
    │       ├── dump: /home/user/dump_files/20150303/1425357071.51_Service_res.xml
    │       └── timestamp: 2015-03-03 04:31:11.513453
    └── app:soap:service:request/3 ⇒ succeeded
        ├── status: 200
        └── timestamp: 2015-03-03 04:31:11.513992

was generated from:

{"dump": "/home/user/dump_files/20150303/1425356936.28_Client_req.xml", "timestamp": 1425356936.278875, "uri": "http://example.org/soap", "action_status": "started", "task_uuid": "f3a32bb3-ea6b-457c-aa99-08a3d0491ab4", "action_type": "app:soap:client:request", "soapAction": "a_soap_action", "task_level": [1]}
{"timestamp": 1425356937.516579, "task_uuid": "f3a32bb3-ea6b-457c-aa99-08a3d0491ab4", "action_type": "app:soap:client:success", "action_status": "started", "task_level": [2, 1]}
{"task_uuid": "f3a32bb3-ea6b-457c-aa99-08a3d0491ab4", "action_type": "app:soap:client:success", "dump": "/home/user/dump_files/20150303/1425356937.52_Client_res.xml", "timestamp": 1425356937.517077, "action_status": "succeeded", "task_level": [2, 2]}
{"status": 200, "task_uuid": "f3a32bb3-ea6b-457c-aa99-08a3d0491ab4", "task_level": [3], "action_type": "app:soap:client:request", "timestamp": 1425356937.517161, "action_status": "succeeded"}
{"dump": "/home/user/dump_files/20150303/1425357068.03_Service_req.xml", "timestamp": 1425357068.032091, "uri": "/endpoints/soap/method", "action_status": "started", "task_uuid": "89a56df5-d808-4a7c-8526-e603aae2e2f2", "action_type": "app:soap:service:request", "soapAction": "method", "task_level": [1]}
{"timestamp": 1425357071.51233, "task_uuid": "89a56df5-d808-4a7c-8526-e603aae2e2f2", "action_type": "app:soap:service:success", "action_status": "started", "task_level": [2, 1]}
{"task_uuid": "89a56df5-d808-4a7c-8526-e603aae2e2f2", "action_type": "app:soap:service:success", "dump": "/home/user/dump_files/20150303/1425357071.51_Service_res.xml", "timestamp": 1425357071.513453, "action_status": "succeeded", "task_level": [2, 2]}
{"status": 200, "task_uuid": "89a56df5-d808-4a7c-8526-e603aae2e2f2", "task_level": [3], "action_type": "app:soap:service:request", "timestamp": 1425357071.513992, "action_status": "succeeded"}

Streaming

It’s possible to pipe data into eliot-tree, from a tailed log for example, and have it rendered incrementally. There is a caveat though: Trees are only rendered once an end message—a success or failure status—for the tree’s root action appears in the data.

Usage from Python

import json, sys
from eliottree import tasks_from_iterable, render_tasks
# Or `codecs.getwriter('utf-8')(sys.stdout).write` on Python 2.
render_tasks(sys.stdout.write, tasks, colorize=True)

See help(render_tasks) and help(tasks_from_iterable) from a Python REPL for more information.

Usage from the command-line

$ eliot-tree
usage: eliot-tree [-h] [-u UUID] [-i KEY] [--raw]
                  [--color {always,auto,never}] [--no-colorize] [-l LENGTH]
                  [--select QUERY] [--start START] [--end END]
                  [FILE [FILE ...]]

Display an Eliot log as a tree of tasks.

positional arguments:
  FILE                  Files to process. Omit to read from stdin.

optional arguments:
  -h, --help            show this help message and exit
  -u UUID, --task-uuid UUID
                        Select a specific task by UUID
  -i KEY, --ignore-task-key KEY
                        Ignore a task key, use multiple times to ignore
                        multiple keys. Defaults to ignoring most Eliot
                        standard keys.
  --raw                 Do not format some task values (such as UTC
                        timestamps) as human-readable
  --color {always,auto,never}
                        Color the output. Defaults based on whether the output
                        is a TTY.
  -l LENGTH, --field-limit LENGTH
                        Limit the length of field values to LENGTH or a
                        newline, whichever comes first. Use a length of 0 to
                        output the complete value.
  --select QUERY        Select tasks to be displayed based on a jmespath
                        query, can be specified multiple times to mimic
                        logical AND. If any child task is selected the entire
                        top-level task is selected. See <http://jmespath.org/>
  --start START         Select tasks whose timestamp occurs after (or on) an
                        ISO8601 date.
  --end END             Select tasks whose timestamp occurs before an ISO8601
                        date.

Contribute

See <https://github.com/jonathanj/eliottree> for details.

Metadata

Release files for eliot-tree 18.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for eliot-tree 18.0.0
File Size Uploaded Provenance Actions
eliot-tree-18.0.0.tar.gz 76.9 kB Without provenance Details for eliot-tree-18.0.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for eliot-tree 18.0.0
File Interpreter ABI Platform Actions
eliot_tree-18.0.0-py3-none-any.whl Python 3 none any Details for eliot_tree-18.0.0-py3-none-any.whl
eliot_tree-18.0.0-py2-none-any.whl Python 2 none any Details for eliot_tree-18.0.0-py2-none-any.whl

Total release size: 234.4 kB

Release files / eliot-tree-18.0.0.tar.gz

Download URL eliot-tree-18.0.0.tar.gz
Size 76.9 kB
Tags Source
SHA-256 checksum
How to use checksums
78ba207afa12540b7b881a78e50e61b6dfaeb2e9b3d2b2185b09b74524761561
BLAKE2b-256 checksum
How to use checksums
8f3a915fd6cdd297400e3cace5ec5d575270dfe34e9e167a7e9936971ea8869a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / eliot_tree-18.0.0-py3-none-any.whl

Download URL eliot_tree-18.0.0-py3-none-any.whl
Size 78.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0fd796ce1a62701c527a15a46efe8ed4e0b3956b1f831a497f2adfc85240df11
BLAKE2b-256 checksum
How to use checksums
854afd5d16850c21fa737fa77be221c34e9ae1a3608b206200dfcc883c1d4d02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / eliot_tree-18.0.0-py2-none-any.whl

Download URL eliot_tree-18.0.0-py2-none-any.whl
Size 78.7 kB
Tags Python 2
SHA-256 checksum
How to use checksums
c3fe7ee02e05cb85ca90223538415a61664c025f6c4818ec7346e7bc5bb5ed8e
BLAKE2b-256 checksum
How to use checksums
a484020b28a5daebcc3a621bb404700065e42050026fd5f6381e09f81a8b6fc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for eliot-tree 18.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page