Dev.to · 3 min read

I created an interactive TUI log debugger in Python because grep and tail are driving me crazy.

I created an interactive TUI log debugger in Python because grep and tail are driving me crazy.

Every time something goes wrong in production, the ritual is the same: you connect to the server, open the logs, and stumble upon a huge wall of text. You strain your eyes, trying to spot the single line with the ERROR hidden among the megabytes of INFORMATION and DEBUG DATA. Of course, we have grep, tail -f. But when a giant multi‑line trace appears in the console, reading it in a standard terminal is a nightmare. I got tired of this, so I created TraceTUI — a beautiful interactive debugger for logs in the terminal. 🪵 Pain Logs are usually generated either by the standard logging library or by the modern loguru. When working with multiple services or workers, you have to either open a dozen tabs in the terminal or write convoluted bash scripts. To make matters worse, to switch between periodically occurring errors and view deep traces, you have to scroll the terminal window up and down endlessly. 🛠️ What can TraceTUI do? I created an interface based on the Textual framework and divided it into three logical panels: The left panel (sources): a list of active log files. You can view several logs simultaneously and switch between them using the arrow keys. The central panel (log stream): the main log strip with automatic color coding for severity levels. Errors are highlighted in bright red, so they’re immediately visible. Right panel (details): displays the full trace, metadata, and custom tags. No more hassle with text wrapping. 🚀 Killer features • Format autodetection: recognizes loguru, standard logging, or plain text out of the box. • Smart error navigation: press E (next error), and the interface will instantly skip thousands of irrelevant informational lines to take you straight to the next warning or exception. • Real‑time filtering: press F to open the filtering mode. Enter a search query, and the log stream will be dynamically updated on the fly. • Timeline merging mode: press m to merge several log files into a single chronological timeline with source tags. 📦 Give it a spin! The project is completely open-source under the MIT license. You can install it with a single command via pip: pip install tracetui To run it, simply pass your log files as arguments: tracetui app_loguru.log server.log 💬 Conclusion I hope this small utility will save you from headaches during your next debugging session. The project is still young, so I’d be glad to hear your thoughts! What’s missing? What can be improved? Leave a comment below or create an issue on GitHub.

This is a summary aggregated from Dev.to. Read the complete article on the original site:

Read full article at Dev.to

More Programming & Dev News