LogViewer
A modern log viewer with AI-assisted analysis (Qt 6)
Loading...
Searching...
No Matches
LogViewer

A modern, cross-platform log viewer built with Qt 6 and C++20, featuring AI-assisted analysis, flexible filtering, and customizable visualization.

Features

Core

  • Multiple Log Formats: XML, CSV, CAN/ASC (Vector CANalyzer), AUTOSAR DLT (.dlt), POSIX Evlog (.evl), and safeAPI RBC 2oo2 merged test logs (.txt with the merged-log header)
  • safeAPI Payload Fields: Structured payloads of safeAPI merged test logs become extra fields — key=value lists and JSON objects as p.<key> (e.g. p.cycle, p.role, p.status, p.cmd, p.fields.route_len), the [a-west | GP] channel marker in info as unit. Add them as columns in Tools > Settings > Columns to filter them, or use them in Statistics and Traces; the raw payload stays unchanged
  • Run Explorer: File > Open Results Folder… (Ctrl+Alt+O) or dropping a folder lists the tests of a test-run results folder (one safeAPI *__merged_logs.txt per test) with verdict, duration, entry count and failure message — the decisive step failure, or Robot Framework's xunit.xml/output.xml message when the log records none. Filter by verdict, group failures by message, double-click to open a test, or Open with Previous Test to merge it with the test that ran before it
  • DBC Signal Decoding: Load a .dbc file alongside an ASC log to decode raw CAN frames into named signals
  • Evlog Template Decoding: Load a directory of .t/.tmpl/.template files to decode structured BINARY evlog payloads into named fields
  • High Performance: Virtual list architecture handles millions of log entries
  • Advanced Filtering: Text search, regex, time-range, and type-based filters with configurable field selection
  • Filter Profiles: Save and restore named filter states for quick context switching
  • Quick Filters: Right-click a cell in the events table to Show Only or Exclude its value (a column filter, combined with any filter the column already has), Show Events Around This One (±2/5/10/30 s around its timestamp, on top of the current filter) or show the Conversation of its sender and receiver (both directions, comma lists included); undo with Clear All Column Filters and Clear Time Window
  • Flexible UI: Dock-based layout — move, float, or hide panels as needed
  • Named Layouts: Save and restore complete dock arrangements under custom names
  • Persistent Settings: JSON-based configuration with platform-specific storage

Analysis Panels

  • Signal Plot: Plot decoded CAN signal values (SIG:* fields) over time — select any combination with checkboxes; auto-downsamples to 2 000 points per series
  • Statistics: Format-aware summary — generic key metrics for all formats; CAN-specific frame breakdown (Rx/Tx/error counts, unique IDs, frame rate) and signal ranges (min/max/avg) for ASC files
  • Timeline Chart: Interactive bar histogram of event volume over time with zoom and brush selection
  • Pattern Analysis: Template clustering that groups structurally similar log lines
  • Trace Viewer: Sequence-diagram-style view grouped by actor
  • Test Steps: Outline of a test log (safeAPI merged logs: TEST_START … TEST_END) — sections from the author's TestStep N / TestExpectation markers with every keyword, start offset, duration and status (passed, failed but recovered by a retry, failed, probably not run); a PASS/FAIL banner names the step and message that failed the test, with Go to failure; double-click or Enter jumps to a step in the Events tab. The Dashboard shows the test case and verdict from the file header
  • Bookmarks: Annotate and navigate to important events
  • Scenarios: Define multi-step event sequences and export matches as JSON Lines
  • Actors: Event attribution tree built from configurable actor definitions

Side-by-Side Comparison

  • Split View: Load two log files simultaneously in a vertically-split panel
  • Timestamp Sync: Selecting a row on one side auto-scrolls the other to the nearest timestamp
  • Manual Sync: Mark a reference event on each side to compute a constant offset — useful when comparing DLT (epoch) and ASC (elapsed) logs with different time bases
  • Independent View: Disable sync entirely for free-scrolling on both sides

AI-Assisted Analysis

  • Multiple Providers: Ollama (local), LM Studio (local), OpenAI, Anthropic Claude, Google Gemini, xAI Grok
  • Smart Analysis: Automatic pattern detection, error summarization, and insights
  • Filter-Aware: AI respects your current filters and type field configuration
  • Custom Prompts: Save and load analysis prompts for different log types

Plugin System

  • C-ABI Interface: Stable binary interface across compiler versions
  • Dynamic Loading: Plugins loaded from ZIP archives or directories
  • UI Extension: Plugins can add panels to main, bottom, left, and right dock areas
  • Configuration Panels: Each plugin provides its own configuration tab in the left dock
  • Integrated Logging: Plugins log to the application via callback mechanism

Requirements

Component Version
CMake 3.25+
C++ Compiler Clang 15+, GCC 11+, or MSVC 2019+
Qt 6.5+
Ninja Recommended

Install Qt:

# macOS
brew install qt@6
# Linux (Debian/Ubuntu)
sudo apt-get install qt6-base-dev qt6-tools-dev
# Windows — download from qt.io or use vcpkg

Building

Quick Start

# macOS
cmake --preset macos-debug-qt
cmake --build --preset macos-debug-build-qt
./build/macos-debug-qt/src/main/LogViewer.app/Contents/MacOS/LogViewer
# Linux
cmake --preset linux-debug-qt
cmake --build --preset linux-debug-build-qt
./build/linux-debug-qt/bin/LogViewer
# Windows (MSYS2)
cmake --preset windows-msys-debug-qt
cmake --build --preset windows-msys-debug-qt-build

Release Builds

# macOS
cmake --preset macos-release-qt
cmake --build --preset macos-release-build-qt
# Linux
cmake --preset linux-release-qt
cmake --build --preset linux-release-build-qt
# Windows
cmake --preset windows-msys-release-qt
cmake --build --preset windows-msys-release-qt-build

Running Tests

ctest --preset macos-debug-test-qt # macOS
ctest --preset linux-debug-test-qt # Linux
ctest --preset windows-msys-debug-qt-test # Windows

Code Quality Tools

The build system includes targets for static analysis, sanitizers, and formatting.

Sanitizers (debug presets)

The macos-debug-qt and linux-debug-qt presets enable AddressSanitizer + UBSan automatically. Controlled via:

cmake --preset macos-debug-qt -DLOGVIEWER_SANITIZER=Address # ASan + UBSan (default)
cmake --preset macos-debug-qt -DLOGVIEWER_SANITIZER=Thread # TSan
cmake --preset macos-debug-qt -DLOGVIEWER_SANITIZER=UndefinedBehavior # UBSan only
cmake --preset macos-debug-qt -DLOGVIEWER_SANITIZER=None # disabled

Static Analysis

# cppcheck (requires ENABLE_CPPCHECK=ON, set in debug presets)
cmake --build --preset macos-cppcheck
cmake --build --preset linux-cppcheck
# clang-tidy
cmake --build --preset macos-clang-tidy
cmake --build --preset linux-clang-tidy
# Run all quality tools (cppcheck + tidy + format check)
cmake --build --preset macos-quality-tools
cmake --build --preset linux-quality-tools

Formatting

# Check formatting (CI mode — exits non-zero on violations)
cmake --build build/macos-debug-qt --target format-check
# Apply formatting in-place
cmake --build --preset macos-format
cmake --build --preset linux-format

See docs/CPPCHECK.md and docs/SANITIZERS.md for details.

Plugin Development

LogViewer provides an official Plugin SDK for extending functionality.

Getting Started

  1. SDK Getting Started Guide — Complete walkthrough with examples
  2. SDK Quick Reference — Syntax reference and common patterns
  3. Basic Plugin Example — Minimal working plugin

Building the Example Plugin

# Build and install the SDK
cmake --preset macos-release-qt
cmake --build --preset macos-release-build-qt
cmake --install build/macos-release-qt --prefix ~/LogViewer_install
# Build the example plugin
cd examples/BasicPlugin
cmake -S . -B build -DCMAKE_PREFIX_PATH=~/LogViewer_install/sdk/lib/cmake
cmake --build build

Plugin Documentation

Configuration

Settings are stored per-platform:

Platform Location
macOS ~/Library/Application Support/LogViewer/config.json
Linux ~/.config/LogViewer/config.json
Windows APPDATA%/LogViewer/config.json

Example configuration:

{
"filters": {
"typeFilterField": "level"
},
"columns": ["timestamp", "level", "message", "source"],
"columnColors": {
"level": {
"ERROR": {"foreground": "#ffffff", "background": "#dc3545"},
"WARN": {"foreground": "#000000", "background": "#ffc107"},
"INFO": {"foreground": "#000000", "background": "#28a745"},
"DEBUG": {"foreground": "#ffffff", "background": "#6c757d"}
}
}
}

Portable mode (no installation)

The Windows release ships LogViewer-<version>-win64-portable.zip: unzip it anywhere and run LogViewer.exe. It contains an empty portable.txt next to the executable; while that file exists, LogViewer keeps everything in a data/ folder beside the executable (config, themes, plugins, session, search history, window layout, saved layouts and scenarios, logs) and writes nothing to APPDATA% or the registry. Delete portable.txt to switch back to the normal per-user profile. The same marker works for any other build of the app.

AI Setup

Local AI (Recommended for Privacy)

Ollama:

brew install ollama # macOS
ollama serve
ollama pull llama3.2

LM Studio: Download from https://lmstudio.ai, load a model, start the local server, and point LogViewer at http://localhost:1234.

Cloud Providers

Configure in Settings > AI with an API key:

Provider Key source
OpenAI https://platform.openai.com
Anthropic https://console.anthropic.com
Google Gemini https://ai.google.dev
xAI Grok https://x.ai

Usage

  1. Open Log File — File > Open (Ctrl+O); supports XML, CSV, .asc CAN, .dlt DLT, .evl Evlog, and safeAPI merged test logs (.txt, auto-detected by header); drag and drop also works. File > Open Results Folder… (Ctrl+Alt+O) — or dropping a folder — opens a test-run results folder in the Run Explorer
  2. Load DBC — File > Load DBC… to decode CAN signals from a .dbc database (optional, ASC only)
  3. Load Evlog Templates — File > Load Evlog Templates… to select a directory of template files for .evl BINARY payload decoding
  4. Filter — Use the Filters panel; filter by type, text, regex, or time range; save filter states as named profiles
  5. Inspect — Select an entry to see full details in the Details panel; press Ctrl+G to jump to a specific timestamp
  6. Copy — Right-click events to copy as JSON or CSV; Ctrl+C copies plain text
  7. Plot Signals — Switch to the Signals tab; check SIG:* fields in the Signal Browser dock to plot values over time (ASC + DBC required)
  8. Statistics — The Statistics tab shows format-aware metrics; CAN files show Rx/Tx/error counts, unique IDs, frame rate, and signal ranges
  9. Side-by-Side — Open the Side by Side tab or press Ctrl+Shift+S; load two files and choose a sync mode
  10. AI Analysis — Open the bottom AI panel, write or load a prompt, click Analyze
  11. Layouts — View > Layouts to save, restore, or delete named dock arrangements
  12. Export — File > Export to save visible events as CSV, JSON, or XML

Project Structure

LogViewer/
├── src/
│ ├── application/ # Core application logic
│ │ ├── ai/ # Local/remote AI inference (Gemma via llama.cpp, providers)
│ │ ├── analyzers/ # Log analysis (pattern detection, actor discovery, etc.)
│ │ ├── config/ # Configuration management
│ │ ├── db/ # EventsContainer and LogEvent data model
│ │ ├── error/ # Result<T,E> and error types
│ │ ├── filters/ # Filtering system
│ │ ├── mvc/ # Model-View-Controller patterns
│ │ ├── parsers/ # Log parsers
│ │ │ ├── xml/ # XML parser
│ │ │ ├── csv/ # CSV parser
│ │ │ ├── asc/ # CAN/ASC parser (Vector CANalyzer format)
│ │ │ └── dbc/ # DBC parser + CAN signal decoder
│ │ ├── plugins/ # Plugin system interfaces
│ │ ├── services/ # Application-level services
│ │ ├── ui/qt/ # Qt 6 UI components
│ │ │ ├── panels/ # Dock and content panels
│ │ │ ├── dialogs/ # Modal dialogs
│ │ │ ├── events/ # Events table model and view
│ │ │ └── utils/ # Shared UI utilities
│ │ ├── updates/ # Update checking
│ │ ├── util/ # General utilities
│ │ └── version/ # Version info
│ ├── plugin_api/ # C-ABI plugin interface headers
│ └── main/ # Application entry point
├── plugins/ # First-party plugins
│ └── ai/ # AI provider plugin
├── examples/BasicPlugin/ # Minimal plugin example
├── tests/ # Unit tests (Google Test)
├── cmake/ # Build helper modules
│ ├── Warnings.cmake # Compiler warning flags
│ ├── EnableSanitizers.cmake
│ ├── ClangTidy.cmake
│ ├── Cppcheck.cmake
│ └── ClangFormat.cmake
├── docs/ # Documentation
├── etc/ # Default config files
└── thirdparty/ # Third-party dependencies

Packaging

# macOS — produces dist/packages/LogViewer-1.11.0-Darwin.dmg
cmake --preset macos-release-qt
cmake --build --preset macos-release-build-qt
cmake --install build/macos-release-qt --prefix dist/staging
cd build/macos-release-qt && cpack --config CPackConfig.cmake
# Linux — produces .tar.gz and .deb
cmake --preset linux-release-qt
cmake --build --preset linux-release-build-qt
cmake --install build/linux-release-qt --prefix dist/staging
cd build/linux-release-qt && cpack --config CPackConfig.cmake
# Windows — produces .zip
cmake --preset windows-msys-release-qt
cmake --build --preset windows-msys-release-qt-build
cmake --install build/windows-msys-release-qt --prefix dist/staging
cd build/windows-msys-release-qt && cpack --config CPackConfig.cmake

Troubleshooting

Qt not found:

# macOS — pass the prefix explicitly
export CMAKE_PREFIX_PATH="$(brew --prefix qt@6)"
cmake --preset macos-debug-qt

CMake version too old:

brew upgrade cmake # macOS
# or download from https://cmake.org/download/

AI timeout errors: Increase timeout in Settings > AI > Timeout. Use local providers (Ollama/LM Studio) for better performance.

Plugin config panel not visible: Ensure the plugin is enabled in Settings > Plugins. The panel appears as a separate tab in the left dock alongside "Filters". Check application logs for [plugin] messages.

**Qt initialization crash (getcwd failed):** Occurs when the working directory is deleted or unmounted after launch. The application falls back gracefully to /etc for config discovery since v1.0.0.

Documentation

Document Description
docs/USER_MANUAL.md End-user guide — all features with keyboard shortcuts
docs/ARCHITECTURE.md System design and patterns
docs/DEVELOPMENT.md Build system, code style
docs/BUILD_GUIDE.md Detailed build instructions
docs/SDK_GETTING_STARTED.md Plugin SDK quickstart
docs/PLUGIN_SYSTEM.md Plugin architecture
docs/AI_ANALYSIS_GUIDE.md Using AI features
docs/SANITIZERS.md Sanitizer configuration
docs/CPPCHECK.md Static analysis setup

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Follow the code style in docs/DEVELOPMENT.md
  4. Add tests for new functionality
  5. Ensure all tests pass: ctest --preset macos-debug-test-qt
  6. Open a Pull Request

License

MIT License — see license.md for details.

Third-party libraries:

  • Qt 6: LGPL v3 (dynamically linked)
  • nlohmann/json, spdlog, fmt, CURL, Google Test: MIT / BSD

Support