From f73399e569930995470d8ffb471076ef5fdf0263 Mon Sep 17 00:00:00 2001 From: moonshadow565 Date: Sat, 11 May 2024 21:36:06 +0200 Subject: [PATCH] reduce wait exit log spam --- cslol-tools/lib/lol/patcher/patcher_win32.cpp | 1 - cslol-tools/src/main_mod_tools.cpp | 3 +-- src/CSLOLToolsImpl.cpp | 2 +- src/qml/CSLOLDialogSettings.qml | 6 +++++- src/qml/main.qml | 4 ++-- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/cslol-tools/lib/lol/patcher/patcher_win32.cpp b/cslol-tools/lib/lol/patcher/patcher_win32.cpp index 6e70893..8730a97 100644 --- a/cslol-tools/lib/lol/patcher/patcher_win32.cpp +++ b/cslol-tools/lib/lol/patcher/patcher_win32.cpp @@ -58,7 +58,6 @@ auto patcher::run(std::function update, // post log message update(M_WAIT_EXIT, msg); } - if (!msg) update(M_WAIT_EXIT, ""); return tid != cslol_find(); }, []() -> bool { throw PatcherTimeout(std::string("Timed out exit")); }); diff --git a/cslol-tools/src/main_mod_tools.cpp b/cslol-tools/src/main_mod_tools.cpp index d012cdd..401fc08 100644 --- a/cslol-tools/src/main_mod_tools.cpp +++ b/cslol-tools/src/main_mod_tools.cpp @@ -277,9 +277,8 @@ static auto mod_runoverlay(fs::path overlay, fs::path config_file, fs::path game } if (msg == patcher::M_WAIT_EXIT) { if (arg && *arg) { - fprintf(stdout, "patcher: %s\n", arg); + fprintf(stdout, "[DLL] %s\n", arg); fflush(stdout); - old_msg = patcher::M_COUNT_OF; } } }, diff --git a/src/CSLOLToolsImpl.cpp b/src/CSLOLToolsImpl.cpp index a5c60f0..13c09d9 100644 --- a/src/CSLOLToolsImpl.cpp +++ b/src/CSLOLToolsImpl.cpp @@ -47,7 +47,7 @@ void CSLOLToolsImpl::setState(CSLOLState value) { void CSLOLToolsImpl::setStatus(QString status) { if (status_ != status) { logFile_->write((status.toUtf8() + "\n")); - if (!status.startsWith("[WRN] ")) { + if (!status.startsWith("[WRN] ") && !status.startsWith("[DLL] ")) { status_ = status; emit statusChanged(status); } diff --git a/src/qml/CSLOLDialogSettings.qml b/src/qml/CSLOLDialogSettings.qml index 26c193b..6f01829 100644 --- a/src/qml/CSLOLDialogSettings.qml +++ b/src/qml/CSLOLDialogSettings.qml @@ -165,9 +165,13 @@ Dialog { } Switch { id: debugPatcherCheck - text: qsTr("Debug patcher") + text: qsTr("Verbose logging") checked: false Layout.fillWidth: true + CSLOLToolTip { + text: qsTr("Helps diagnose issues comming from patcher.") + visible: parent.hovered + } } } ColumnLayout { diff --git a/src/qml/main.qml b/src/qml/main.qml index 0e05bab..8b3d822 100644 --- a/src/qml/main.qml +++ b/src/qml/main.qml @@ -31,7 +31,7 @@ ApplicationWindow { property alias themeDarkMode: cslolDialogSettings.themeDarkMode property alias themePrimaryColor: cslolDialogSettings.themePrimaryColor property alias themeAccentColor: cslolDialogSettings.themeAccentColor - property alias debugPatcher: cslolDialogSettings.debugPatcher + property alias verbosePatcher: cslolDialogSettings.debugPatcher property alias removeUnknownNames: cslolDialogEditMod.removeUnknownNames property alias lastZipDirectory: cslolDialogOpenZipFantome.folder @@ -98,7 +98,7 @@ ApplicationWindow { let name = cslolToolBar.profilesCurrentName let mods = cslolModsView.saveProfile() if (checkGamePath()) { - cslolTools.saveProfile(name, mods, run, settings.suppressInstallConflicts, settings.debugPatcher) + cslolTools.saveProfile(name, mods, run, settings.suppressInstallConflicts, settings.verbosePatcher) } }