From 29bed869f55a3d77cc0f857a2ee751758bd9cad6 Mon Sep 17 00:00:00 2001 From: denbond7 Date: Fri, 7 Feb 2025 10:46:32 +0200 Subject: [PATCH] Disabled logging for Gmail API by default(reverted back missed changes).| #2931 --- .../flowcrypt/email/api/email/gmail/GmailApiHelper.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/gmail/GmailApiHelper.kt b/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/gmail/GmailApiHelper.kt index 4291d32e2d..833a762b6b 100644 --- a/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/gmail/GmailApiHelper.kt +++ b/FlowCrypt/src/main/java/com/flowcrypt/email/api/email/gmail/GmailApiHelper.kt @@ -32,6 +32,7 @@ import com.flowcrypt.email.security.model.PgpKeyRingDetails import com.flowcrypt.email.security.pgp.PgpKey import com.flowcrypt.email.ui.notifications.ErrorNotificationManager import com.flowcrypt.email.util.FlavorSettings +import com.flowcrypt.email.util.GeneralUtil import com.flowcrypt.email.util.exception.CommonConnectionException import com.flowcrypt.email.util.exception.ExceptionUtil import com.flowcrypt.email.util.exception.GmailAPIException @@ -198,9 +199,11 @@ class GmailApiHelper { val credential = generateGoogleAccountCredential(context, account) val transport = NetHttpTransport() - Logger.getLogger(HttpTransport::class.java.name).apply { - level = Level.CONFIG - addHandler(object : ConsoleHandler() {}.apply { level = Level.CONFIG }) + if (GeneralUtil.isDebugBuild() && EmailUtil.hasEnabledDebug(context)) { + Logger.getLogger(HttpTransport::class.java.name).apply { + level = Level.CONFIG + addHandler(object : ConsoleHandler() {}.apply { level = Level.CONFIG }) + } } val factory = GsonFactory.getDefaultInstance()