µLogger
Modern terminal-based viewer for ULog embedded traces
µLogger is a powerful TUI (Text User Interface) application for viewing real-time logs from embedded systems using the ULog API. It combines a serial console with intelligent log parsing and filtering capabilities.
✨ Features
- 🖥️ Modern Textual TUI - Beautiful terminal interface with rich formatting
- 📦 Standalone Executable - No Python installation required (Windows)
- 🎨 Color-Coded Logs - Different colors for each log level
- 🔍 Advanced Filtering - Filter by file, log level, or search text
- 💾 Persistent Settings - Remembers recent files and COM ports
- 🔌 Hot-Swap COM Ports - Change serial ports without restarting
- 📊 Real-Time Statistics - Live log counts and buffer status
- 🔎 Log Viewer - Browse all log definitions from ELF file
🚀 Quick Start
Download Standalone Executable (Windows)
- Download
ulogger.exefrom latest release - Double-click to run (auto-opens in terminal) or run from command line
- Select your ELF file and COM port from the dialogs
Install with pip
pip install adarwoo-ulogger
Run from source
git clone https://github.com/adarwoo/ulogger.git
cd ulogger
poetry install
poetry run python -m ulogger
📖 Usage
ulogger [elf_file] [-C COM_PORT] [-l LEVEL] [-b BUFFER_DEPTH]
Example:
ulogger firmware.elf -C COM4
First time usage: Simply run ulogger and use the interactive dialogs to select your ELF file and COM port.
📸 Screenshots
Main Interface
Real-time log viewing with color-coded levels and filtering
File Filter
Filter logs by source file with per-level counts
Level Filter
Select which log levels to display
Log Entries Viewer
Browse all log definitions from the ELF file with sort and search
File Selection
Select ELF file from recent files or browse
COM Port Selection
Choose serial port for live logging
💡 Note: Screenshots captured using Textual's built-in SVG export feature for crisp, scalable images.
Usage
You install the viewer using pip install or build a windows executable with pyinstaller.
usage: ulog_console.exe [-h] [-l LEVEL] [-x] [-C COMM] [-b BUFFER_DEPTH] elf
ulog trace viewer (ncurses + live UART)
positional arguments:
elf Path to ELF file with .logs section
options:
-h, --help show this help message and exit
-l, --level LEVEL Display log level threshold (0–8)
-x, --clear Clear screen on ELF reload
-C, --comm COMM UART serial port (e.g. /dev/ttyUSB0 or COM4)
-b, --buffer-depth BUFFER_DEPTH
Internal buffer depth (e.g. 100k, 2M). Default: 100000
⌨️ Keyboard Controls
| Key | Action |
|---|---|
z |
Freeze/Unfreeze display (buffer keeps filling) |
c |
Clear all logs |
l |
Open level filter dialog |
+/- |
Expand/Contract level filter |
f |
Open file filter dialog |
p |
Select COM port |
r |
Reset all filters |
e |
View all log entry definitions from ELF |
v |
View all log lines in modal |
q |
Quit application |
↑/↓ |
Scroll up/down |
PgUp/PgDn |
Page up/down |
Home/End |
Jump to top/bottom |
In File/Level Filter Dialogs:
- Click on items to toggle selection
- Press
0-8on a file to view logs at that level - Press
Enteron a file to view all its logs Escorqto close dialog
In Log Entries Viewer:
s- Cycle sort mode (none → level → file)Ctrl+F- Toggle searchEsc- Close search or exit viewer
📋 Command-Line Options
usage: ulogger [-h] [-l LEVEL] [-x] [-C COMM] [-b BUFFER_DEPTH] [elf]
positional arguments:
elf Path to ELF file with .logs section (optional)
options:
-h, --help Show help message
-l, --level LEVEL Display log level threshold (0-8, default: 8)
-x, --clear Clear screen on ELF reload
-C, --comm COMM UART serial port (e.g. /dev/ttyUSB0 or COM4)
-b, --buffer-depth BUFFER_DEPTH
Internal buffer depth (e.g. 100k, 2M, default: 100000)
🎯 Log Levels
| Level | Name | Color | Use Case |
|---|---|---|---|
| 0 | ERROR | Red | Critical errors |
| 1 | WARN | Yellow | Warnings |
| 2 | MILE | Bright Yellow | Milestones |
| 3 | INFO | Green | General info |
| 4 | TRACE | Blue | Trace execution |
| 5 | DEBUG0 | White | Debug info |
| 6 | DEBUG1 | Gray | Detailed debug |
| 7 | DEBUG2 | Dim | Very detailed |
| 8 | DEBUG3 | Dim | Maximum detail |
🏗️ Building from Source
Requirements
- Python 3.9+
- Poetry (package manager)
Development Setup
# Clone repository
git clone https://github.com/adarwoo/ulogger.git
cd ulogger
# Install dependencies
poetry install
# Run in development
poetry run python -m ulogger
# Run tests (if available)
poetry run pytest
Building Standalone Executable
# Install build dependencies
poetry add --group dev pyinstaller
# Generate icon (optional)
python create_icon.py
# Build executable
poetry run pyinstaller ulogger.spec
# Output: dist/ulogger.exe
The executable includes:
- ✅ All Python dependencies bundled
- ✅ Auto-terminal launch when double-clicked
- ✅ Custom icon
- ✅ No installation required
- ✅ ~8.5MB single file
🔧 Technical Details
ULog Library Performance
On AVR microcontrollers, ULog provides exceptional performance:
| Metric | Value | Description |
|---|---|---|
| Library Size | < 300 bytes | Includes UART handling and double buffer |
| Throughput | > 3000 msg/s | At 115200 baud |
| Flash per Log | 8 bytes | Zero RAM overhead |
| RAM Usage | 30-100 bytes | Configurable buffer size |
| CPU Cycles/Trace | 214 (11µs) | Single trace, no arguments |
| CPU Load @ 300 msg/s | < 1% | Includes ULog and UART |
| IDLE Latency | < 23µs | Additional reactor handler latency |
How It Works
ULog uses a clever approach different from other logging libraries:
- Zero-Cost Metadata - All trace information (file, line, format, types) stored in ELF
.logssection (unmapped, uses no flash) - Minimal Runtime - Only trace ID and raw data sent over UART
- COBS Framing - Efficient binary framing (2 extra bytes per message)
- Double Buffering - One buffer for logging, one for UART transmission
- Reactor-Safe - Second buffer fills only when system is idle
Benefits
✅ No preprocessing required - Unlike Trice, no JSON extraction needed ✅ Tiny footprint - 100 debug statements cost < 1KB flash ✅ No code intrusion - Linker script patch optional ✅ Smart filtering - Viewer knows all possible traces upfront ✅ Type-safe - Variable types extracted from ELF, no format strings needed
📦 Dependencies
Runtime
textual >= 0.96.1- Modern TUI frameworkpyserial >= 3.5- Serial port communicationplatformdirs >= 4.0.0- Cross-platform settings storagepyelftools >= 0.31- ELF file parsingsqlalchemy >= 2.0.0- Database models
Development
poetry- Dependency managementpyinstaller >= 6.16.0- Executable building (optional)
🤝 Contributing
Contributions welcome! Please feel free to submit a Pull Request.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🔗 Related Projects
- ULog AVR Library - The embedded logging library
- Textual - Modern TUI framework
💬 Support
Made with ❤️ for embedded developers
Metadata
Release files for adarwoo-ulogger 1.2.0
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 | |
|---|---|---|---|---|
| adarwoo_ulogger-1.2.0.tar.gz | 49.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| adarwoo_ulogger-1.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 101.6 kB
Release files / adarwoo_ulogger-1.2.0.tar.gz
| Download URL | adarwoo_ulogger-1.2.0.tar.gz |
|---|---|
| Size | 49.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c0e08e54d06bca40db06c7a246b47ca3d4a0a170f0cf1f551381ca905e9c40fd
|
|
BLAKE2b-256 checksum How to use checksums |
c5c2ed012c5265b8f375c7ef6f9d8f680b264b5eefa02450360d3a6e2b48570d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.13.3 Windows/11
|
Release files / adarwoo_ulogger-1.2.0-py3-none-any.whl
| Download URL | adarwoo_ulogger-1.2.0-py3-none-any.whl |
|---|---|
| Size | 52.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5b574d581eef638da9ee1584ece91f864119c54cbbb5ca55ec26b1218831b5bf
|
|
BLAKE2b-256 checksum How to use checksums |
c7c2e8eb2f4ab6f85ca0d3a1fddf6adcab07b8db29485bc4670d59f258a631b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.13.3 Windows/11
|
Security for adarwoo-ulogger 1.2.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.