]> Nutra Git (v1) - gamesguru/feather.git/commitdiff
fix logging suppression issues
authorgg <chown_tee@proton.me>
Wed, 14 Jan 2026 15:07:43 +0000 (10:07 -0500)
committergg <chown_tee@proton.me>
Wed, 14 Jan 2026 15:07:43 +0000 (10:07 -0500)
src/main.cpp
src/utils/Utils.cpp

index 3e0afd3236ee9d276f05de03624bffa9a6c4551e..4b57478ec969c358c89f17ed5658eb7e225f8c4e 100644 (file)
@@ -171,9 +171,11 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) {
     }
 
     // Setup logging
-    QString logPath = QString("%1/libwallet.log").arg(configDir);
+    QString logPath = conf()->get(Config::disableLogging).toBool() ? "" : QString("%1/libwallet.log").arg(configDir);
+    bool consoleLogging = !conf()->get(Config::disableLoggingStdout).toBool();
+
     Monero::Utils::onStartup();
-    Monero::Wallet::init("", "feather", logPath.toStdString(), true);
+    Monero::Wallet::init("", "feather", logPath.toStdString(), consoleLogging);
 
     bool logLevelFromEnv;
     int logLevel = qEnvironmentVariableIntValue("MONERO_LOG_LEVEL", &logLevelFromEnv);
@@ -183,11 +185,12 @@ if (AttachConsole(ATTACH_PARENT_PROCESS)) {
         logLevel = conf()->get(Config::logLevel).toInt();
     }
 
-    if (parser.isSet("quiet") || conf()->get(Config::disableLogging).toBool()) {
-        if (conf()->get(Config::disableLogging).toBool()) {
-            qWarning() << "Logging is disabled via configuration";
-        } else {
+    bool disableEverything = parser.isSet("quiet") || (conf()->get(Config::disableLogging).toBool() && conf()->get(Config::disableLoggingStdout).toBool());
+    if (disableEverything) {
+        if (parser.isSet("quiet")) {
             qWarning() << "Logging is disabled via --quiet flag";
+        } else {
+            qWarning() << "Logging is disabled via configuration";
         }
         WalletManager::instance()->setLogLevel(-1);
     }
index d037390fddc661354452209582aa42910d05557c..d9e42776f4893f2994c133420d912e2ec2ce2da2 100644 (file)
@@ -559,7 +559,7 @@ QTextCharFormat addressTextFormat(const SubaddressIndex &index, quint64 amount)
 }
 
 void applicationLogHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg) {
-    if (conf()->get(Config::disableLoggingStdout).toBool() || conf()->get(Config::disableLogging).toBool())
+    if (conf()->get(Config::disableLoggingStdout).toBool())
         return;
 
     int level = conf()->get(Config::logLevel).toInt();