Textualog
Display, filter and search logging messages in the terminal.
This project is powered by rich and textual.
Some of the ideas and code in this project are based on:
Installation
The easiest way to install the package is by running the pip command in the Python virtual environment of your project:
$ python -m pip install [--upgrade] textualog
Usage
The textualog app should have been installed in your environment, then run the following command:
$ textualog --log <path to the log file>
In the examples directory of this project, you can find an example log file to inspect and play with.
The main view is divided in three panels, (1) a Records panel that displays all the logging records in a colored view, (2) a Record Info panel that displays more details about the selected logging message (a message can be selected by a mouse click), and (3) a Levels panel that displays the standard logging levels. Logging levels can be switched on or off with a key press, d=debug, i=info, w=warning, e=error, c=critical. When you click inside the Record Info panel, the main view will change in a Record Details view that displays all information associated with the selected logging message. This view is mainly used when the logging message has extra multi-line information attached, and depending on the amount of information, this view is scrollable. When the selected logging message contains extra information, the Record Info panel will have an asterisk in the title. Use the Escape key to return to the main view.
The app can be terminated with the 'q' key or by pressing CTRL-C. If you need a little help on the keyboard shortcuts, press the '?' key to present the Info Help panel on the right side of the terminal. Also here use the Escape key to hide the help panel again.
Pressing the 'n' key will slide in a Namespaces panel on the left side of the Terminal. This panel is currently not functional. The idea is to allow the user to filter the logging messages by selecting one or more namespaces.
Log file formats
The current support is for a key-value type of log file. The log line shall have a fixed format, which is what I currently use in my main other projects. The following key=value pairs shall be there in the given order:
level=<logging level>ts=<'%Y-%m-%dT%H:%M:%S,%f'>process=<process name>process_id=<PID>caller=<calling function:lineno>msg=<logging message>
In the future other formats can be supported by implementing a plugin class. Planned formats are the JSON format, ...
Roadmap
- Display message details including extra lines that contain further information like e.g. traceback info.
- Implement search functionality to search for strings or regular expressions and position the screen at the first match
- Start work on filtering log messages based on their namespace
Metadata
Release files for textualog 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| textualog-0.1.2.tar.gz | 17.1 kB | Without provenance | Details for textualog-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| textualog-0.1.2-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for textualog-0.1.2-py2.py3-none-any.whl |
Total release size: 37.1 kB
Release files / textualog-0.1.2.tar.gz
| Download URL | textualog-0.1.2.tar.gz |
|---|---|
| Size | 17.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
930e5f76615bbe82c8e7a4aa6573d22e16388e168e99ab873dd3456fae29a808
|
|
BLAKE2b-256 checksum How to use checksums |
df6e4b7b49a7ab88b1f3c6dd9689bf8b4c6229a3583e63e7c90c20f0fba1bf7a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.8.8
|
Release files / textualog-0.1.2-py2.py3-none-any.whl
| Download URL | textualog-0.1.2-py2.py3-none-any.whl |
|---|---|
| Size | 20.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
7d863f40a6304feaf3015b1f2034f45003b70a809db30bfe35ed30706f9b3849
|
|
BLAKE2b-256 checksum How to use checksums |
c1922104ec7a58912ac3de39411dcff9a71dbb9df4f9b2938fbc7cab28c12edb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.8.8
|
Security for textualog 0.1.2
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.