Repository navigation
fix(logging): keep debug output out of the journal - #165
Open
m-wilkowski wants to merge 1 commit into
Open
m-wilkowski wants to merge 1 commit into
m-wilkowski wants to merge 1 commit into
Conversation
m-wilkowski
force-pushed
the
fix/logging-keep-debug-out-of-journal
branch
from
October 17, 2026 10:55
e2eaffe to
1a6ce07
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #112.
Problem
main.cppstarts the app withLogManager::init(true), so the debug preset is on for every user, andLogManager::messageHandlerechoes every message to stderr. When the app starts from the desktop autostart entry, stderr goes to the systemd journal, so each debug line ends up twice: once in~/.local/share/Logitune/Logitune/logs/and once in the journal.Most of the volume comes from two per-event lines:
raw hidraw:inDeviceManager.cppandnotification: featureIndex=inDeviceSession.cpp. Each mouse event produces one of each.On my machine (Fedora 44, GNOME 50, MX Master 4 over Bluetooth) logitune wrote about 10,000 journal lines in 5 minutes, 99% of the user journal. The journal hit its size cap and kept only 3 days of history. The log files reached 33-51 MB per day, which matches the sizes reported in #112.
Changes
LogManager::echoesToStderr()decides what reaches stderr. Warnings and above always do. Debug and info only do when stderr is a terminal, sologitunestarted from a shell still prints everything, and the log file keeps the full trace either way.QtInfoMsgcomes afterQtFatalMsgin the enum, so the check compares by name instead oftype >= QtWarningMsg.logitune.hidpp.rawfor the two per-event lines. The debug preset insetLoggingEnabled(true)does not include it. Anyone debugging the protocol can turn it on withQT_LOGGING_RULES="logitune.hidpp.raw.debug=true".raw hidraw:is only built when that category is enabled.tests/test_log_manager.cppcovers the stderr matrix and checks that the debug preset leaves the raw category off.The log file, the Settings toggle and the crash report flow work as before.
Testing
logitune-tests: 756 passed, 1 failed (HyprlandDesktopFocus.ActiveWindowEventEmitsFocusSignal, the existing HyprlandDesktopFocus.ActiveWindowEventEmitsFocusSignal fails when a firefox .desktop entry is installed #160, fails the same way on master).logitune-tray-tests9/9,logitune-qml-tests72/72.