From f154e2b52c0cf78b0e2b260757b631c9a6184035 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 17 Sep 2019 21:25:41 +0200 Subject: [PATCH] Improved logging --- app/src/main/java/eu/faircode/email/Core.java | 8 ++++---- .../java/eu/faircode/email/ServiceSynchronize.java | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index 6d782ba88c..2017d8288e 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -997,7 +997,7 @@ class Core { for (Folder ifolder : isubscribed) subscription.add(ifolder.getFullName()); } catch (MessagingException ex) { - Log.e(ex); + Log.e(account.name, ex); } if (subscribed_only && ifolders.length == 0) { @@ -1151,7 +1151,7 @@ class Core { folder.uidv = uidv; db.folder().setFolderUidValidity(folder.id, uidv); } catch (MessagingException ex) { - Log.w(ex); + Log.w(folder.name, ex); } // Get reference times @@ -1633,7 +1633,7 @@ class Core { message.mx = false; message.warning = ex.getMessage(); } catch (Throwable ex) { - Log.e(ex); + Log.e(folder.name, ex); message.warning = Helper.formatThrowable(ex, false); } @@ -2028,7 +2028,7 @@ class Core { try { parts.downloadAttachment(context, attachment); } catch (Throwable ex) { - Log.e(ex); + Log.e(folder.name, ex); db.attachment().setError(attachment.id, Helper.formatThrowable(ex, false)); } } diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index fb480badf3..6a967a2191 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -849,17 +849,17 @@ public class ServiceSynchronize extends ServiceBase { ifolder.open(Folder.READ_ONLY); db.folder().setFolderReadOnly(folder.id, true); } catch (MessagingException ex1) { - Log.w(ex1); + Log.w(folder.name, ex1); db.folder().setFolderState(folder.id, null); db.folder().setFolderError(folder.id, Helper.formatThrowable(ex1)); continue; } } catch (FolderNotFoundException ex) { - Log.w(ex); + Log.w(folder.name, ex); db.folder().deleteFolder(folder.id); continue; } catch (MessagingException ex) { - Log.w(ex); + Log.w(folder.name, ex); db.folder().setFolderState(folder.id, null); db.folder().setFolderError(folder.id, Helper.formatThrowable(ex)); continue; @@ -1039,7 +1039,7 @@ public class ServiceSynchronize extends ServiceBase { state); } catch (FolderNotFoundException ex) { - Log.w(ex); + Log.w(folder.name, ex); db.folder().deleteFolder(folder.id); } catch (Throwable ex) { Log.e(folder.name, ex); @@ -1146,14 +1146,14 @@ public class ServiceSynchronize extends ServiceBase { try { unregisterReceiver(alarm); } catch (IllegalArgumentException ex) { - Log.w(new IllegalStateException("Killed", ex)); + Log.w(account.name, new IllegalStateException("Killed", ex)); reload(ServiceSynchronize.this, "killed"); } } Log.i(account.name + " done state=" + state); } catch (StoreClosedException ex) { - Log.w(ex); + Log.w(account.name, ex); } catch (Throwable ex) { Log.e(account.name, ex); EntityLog.log( @@ -1246,7 +1246,7 @@ public class ServiceSynchronize extends ServiceBase { try { unregisterReceiver(alarm); } catch (IllegalArgumentException ex) { - Log.w(new IllegalStateException("Killed", ex)); + Log.w(account.name, new IllegalStateException("Killed", ex)); reload(ServiceSynchronize.this, "killed"); } }