From 489c86dad873587a7ea646b5a8f4c605a625034c Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 25 Nov 2024 17:59:44 +0300 Subject: [PATCH] Added ability to disable debug logs even for debug builds. --- Telegram/SourceFiles/core/launcher.cpp | 4 ++++ Telegram/SourceFiles/logs.cpp | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/core/launcher.cpp b/Telegram/SourceFiles/core/launcher.cpp index 0b6afb7aa..312ce9667 100644 --- a/Telegram/SourceFiles/core/launcher.cpp +++ b/Telegram/SourceFiles/core/launcher.cpp @@ -106,6 +106,10 @@ void ComputeDebugMode() { auto file = QFile(debugModeSettingPath); if (file.exists() && file.open(QIODevice::ReadOnly)) { Logs::SetDebugEnabled(file.read(1) != "0"); +#if defined _DEBUG + } else { + Logs::SetDebugEnabled(true); +#endif } if (cDebugMode()) { Logs::SetDebugEnabled(true); diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index 9a04542ef..382d65aaf 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -335,11 +335,7 @@ void SetDebugEnabled(bool enabled) { } bool DebugEnabled() { -#if defined _DEBUG - return true; -#else return DebugModeEnabled; -#endif } bool WritingEntry() {