Catalog PyPI
PACKAGE EXPLORERView in registry

adarwoo-ulogger

PyPI

Modern terminal-based viewer for ULog embedded traces with real-time serial monitoring

avrdebugembeddedloggingmicrocontrollerserialtextualtuiuart
Versions collected1
Direct dependencies4From release 1.2.0
Last observed20 Oct, 19:09 UTC

README

Version 1.2.0 documentation

µ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.

Release Python

✨ 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)

  1. Download ulogger.exe from latest release
  2. Double-click to run (auto-opens in terminal) or run from command line
  3. 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

Main View

File Filter

Filter logs by source file with per-level counts

File Filter

Level Filter

Select which log levels to display

Level Filter

Log Entries Viewer

Browse all log definitions from the ELF file with sort and search

Log Entries

File Selection

Select ELF file from recent files or browse

ELF File Selection

COM Port Selection

Choose serial port for live logging

Port Selection

💡 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

KeyAction
zFreeze/Unfreeze display (buffer keeps filling)
cClear all logs
lOpen level filter dialog
+/-Expand/Contract level filter
fOpen file filter dialog
pSelect COM port
rReset all filters
eView all log entry definitions from ELF
vView all log lines in modal
qQuit application
↑/↓Scroll up/down
PgUp/PgDnPage up/down
Home/EndJump to top/bottom

In File/Level Filter Dialogs:

  • Click on items to toggle selection
  • Press 0-8 on a file to view logs at that level
  • Press Enter on a file to view all its logs
  • Esc or q to close dialog

In Log Entries Viewer:

  • s - Cycle sort mode (none → level → file)
  • Ctrl+F - Toggle search
  • Esc - 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

LevelNameColorUse Case
0ERRORRedCritical errors
1WARNYellowWarnings
2MILEBright YellowMilestones
3INFOGreenGeneral info
4TRACEBlueTrace execution
5DEBUG0WhiteDebug info
6DEBUG1GrayDetailed debug
7DEBUG2DimVery detailed
8DEBUG3DimMaximum 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:

MetricValueDescription
Library Size< 300 bytesIncludes UART handling and double buffer
Throughput> 3000 msg/sAt 115200 baud
Flash per Log8 bytesZero RAM overhead
RAM Usage30-100 bytesConfigurable buffer size
CPU Cycles/Trace214 (11µs)Single trace, no arguments
CPU Load @ 300 msg/s< 1%Includes ULog and UART
IDLE Latency< 23µsAdditional reactor handler latency

How It Works

ULog uses a clever approach different from other logging libraries:

  1. Zero-Cost Metadata - All trace information (file, line, format, types) stored in ELF .logs section (unmapped, uses no flash)
  2. Minimal Runtime - Only trace ID and raw data sent over UART
  3. COBS Framing - Efficient binary framing (2 extra bytes per message)
  4. Double Buffering - One buffer for logging, one for UART transmission
  5. 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 framework
  • pyserial >= 3.5 - Serial port communication
  • platformdirs >= 4.0.0 - Cross-platform settings storage
  • pyelftools >= 0.31 - ELF file parsing
  • sqlalchemy >= 2.0.0 - Database models

Development

  • poetry - Dependency management
  • pyinstaller >= 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.

💬 Support


Made with ❤️ for embedded developers

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.2.03 Jan 20264

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
adarwoo/ulogger

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:09 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:d0502e87d9eb55632c4a7246bc72eaf49213749482566c86c5aa07d40f7b69fc