Skip to content

About

Desktop log analysis tool (Qt6/C++) with severity dashboards, search/filtering, and AI-powered log explanations via the Gemini API

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Smart Log Analyzer

A desktop log analysis tool built with Qt6/C++ that loads plain-text log files, groups repeated entries, visualizes severity distribution, and uses Google's Gemini API to explain individual log entries in plain language.

C++ Qt CMake vcpkg Gemini API QtTest License

Features

  • Log parsing — loads plain-text log files in the form YYYY-MM-DD HH:MM:SS [LEVEL] Message and groups identical/repeated messages together with occurrence counts and line ranges.
  • Severity overview — distribution chart and top-error list across Info, Warning, Error, Debug, and Critical.
  • KPI cards & filtering — clickable severity cards that filter the log table, bidirectionally synced with the severity distribution bars.
  • Search — free-text search across log messages.
  • Expandable detail rows — view timestamps, line numbers, and surrounding context for any grouped log entry.
  • Explain with AI — sends an expanded log entry to the Gemini API (gemini-2.0-flash) and shows a plain-language explanation of what it means, its likely cause, and suggested next steps.
  • CSV export — export the (filtered) log table to CSV.
  • Persisted settings — Gemini API key stored locally via QSettings.

Architecture

Architecture diagram

The app follows a layered, service-oriented structure:

  • UI layer (src/ui/) — MainWindow and widgets (KpiCardBar, SeverityOverviewPanel, SearchBar, LogTableView/LogTableModel/LogRowDelegate, AiExplainDialog, SettingsDialog).
  • Services layer (src/services/) — LogSession (load pipeline), LogGroupingService, StatisticsService, LogCsvFormatter, GeminiClient.
  • Parser layer (src/parser/) — LogParser, used by LogSession to turn raw log files into LogEntry objects.
  • Models (src/models/) — LogEntry, Severity, MessageSearch.
  • Persistence — QSettings (Gemini API key) and the log files themselves.

Screenshots

Main window

Getting started

Prerequisites

  • CMake 3.23+
  • A C++17 compiler (MSVC on Windows)
  • vcpkg, with VCPKG_ROOT set in your environment
  • Qt6 (fetched automatically by vcpkg via vcpkg.json: gui, widgets, concurrent, network)

Build

cmake --preset default
cmake --build build --config Debug

Note: the first configure can take a while, as vcpkg builds Qt6 from source.

Run

build/Debug/SmartLogAnalyzer.exe

Test

ctest --test-dir build -C Debug

Run a single test:

ctest --test-dir build -C Debug -R test_logtablemodel

Using "Explain with AI"

  1. Get a Gemini API key from Google AI Studio.
  2. In the app, go to Settings > API Key... and paste your key (stored locally via QSettings).
  3. Open a log file, expand a grouped log row, and click Explain with AI to get a plain-language explanation of that entry.

Project structure

.
├── src/
│   ├── main.cpp        # entry point, applies theme, sets QSettings org/app name
│   ├── models/         # LogEntry, Severity, MessageSearch
│   ├── parser/         # LogParser
│   ├── services/       # LogSession, LogGroupingService, StatisticsService,
│   │                    # LogCsvFormatter, GeminiClient
│   └── ui/
│       ├── MainWindow.*
│       ├── theme/      # theme.qss
│       └── widgets/    # KpiCardBar, SeverityOverviewPanel, SearchBar,
│                        # LogTableView/LogTableModel/LogRowDelegate,
│                        # AiExplainDialog, SettingsDialog
├── tests/               # QtTest unit tests (one per class, registered via
│                        # add_log_analyzer_test() in tests/CMakeLists.txt)
├── log_examples/        # sample log files for manual testing
└── docs/                # architecture diagram and screenshots

License

This project is licensed under the MIT License.

About

Desktop log analysis tool (Qt6/C++) with severity dashboards, search/filtering, and AI-powered log explanations via the Gemini API

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages