From 5bcff21119aef4c61156118f8f540599d3264062 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 11 May 2022 14:28:09 +0200 Subject: [PATCH] Reduced logging --- app/src/main/java/eu/faircode/email/Log.java | 5 +++++ app/src/main/java/eu/faircode/email/ServiceSynchronize.java | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/Log.java b/app/src/main/java/eu/faircode/email/Log.java index 8c013c9901..818f39f21e 100644 --- a/app/src/main/java/eu/faircode/email/Log.java +++ b/app/src/main/java/eu/faircode/email/Log.java @@ -1585,6 +1585,11 @@ public class Log { ex.getCause().getMessage().contains("User is authenticated but not connected")) return null; + if (ex instanceof MessagingException && + ex.getMessage() != null && + ex.getMessage().startsWith("OAuth refresh")) + return null; + if (ex instanceof IOException && ex.getCause() instanceof MessageRemovedException) return null; diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index b78cbc61a1..7a59570402 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -2308,7 +2308,10 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences } catch (Throwable ex) { last_fail = ex; iservice.dump(account.name); - Log.e(account.name, ex); + if (ex.getMessage() != null && ex.getMessage().startsWith("OAuth refresh")) + Log.i(account.name, ex); + else + Log.e(account.name, ex); EntityLog.log(this, EntityLog.Type.Account, account, account.name + " connect " + ex + "\n" + android.util.Log.getStackTraceString(ex)); db.account().setAccountError(account.id, Log.formatThrowable(ex));