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.
- Log parsing — loads plain-text log files in the form
YYYY-MM-DD HH:MM:SS [LEVEL] Messageand groups identical/repeated messages together with occurrence counts and line ranges. - Severity overview — distribution chart and top-error list across
Info,Warning,Error,Debug, andCritical. - 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.
The app follows a layered, service-oriented structure:
- UI layer (
src/ui/) —MainWindowand 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 byLogSessionto turn raw log files intoLogEntryobjects. - Models (
src/models/) —LogEntry,Severity,MessageSearch. - Persistence —
QSettings(Gemini API key) and the log files themselves.
- CMake 3.23+
- A C++17 compiler (MSVC on Windows)
- vcpkg, with
VCPKG_ROOTset in your environment - Qt6 (fetched automatically by vcpkg via
vcpkg.json:gui,widgets,concurrent,network)
cmake --preset default
cmake --build build --config DebugNote: the first configure can take a while, as vcpkg builds Qt6 from source.
build/Debug/SmartLogAnalyzer.exectest --test-dir build -C DebugRun a single test:
ctest --test-dir build -C Debug -R test_logtablemodel- Get a Gemini API key from Google AI Studio.
- In the app, go to Settings > API Key... and paste your key (stored locally
via
QSettings). - Open a log file, expand a grouped log row, and click Explain with AI to get a plain-language explanation of that entry.
.
├── 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
This project is licensed under the MIT License.

