From 06ff7303751348737301a34f7b7565d257ac4e20 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 23 Oct 2020 15:56:15 +0200 Subject: [PATCH] Improved operation debugging --- app/src/main/java/eu/faircode/email/Log.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Log.java b/app/src/main/java/eu/faircode/email/Log.java index 721377e5a5..9d1ebc4903 100644 --- a/app/src/main/java/eu/faircode/email/Log.java +++ b/app/src/main/java/eu/faircode/email/Log.java @@ -1535,7 +1535,6 @@ public class Log { db.attachment().setDownloaded(attachment.id, size); } - private static void attachLog(Context context, long id, int sequence) throws IOException { DB db = DB.getInstance(context); @@ -1580,15 +1579,20 @@ public class Log { try (OutputStream os = new BufferedOutputStream(new FileOutputStream(file))) { DateFormat TF = Helper.getTimeInstance(context); - for (EntityOperation op : db.operation().getOperations()) - size += write(os, String.format("%s %d %s/%d %s %s %s\r\n", + for (EntityOperation op : db.operation().getOperations()) { + EntityAccount account = (op.account == null ? null : db.account().getAccount(op.account)); + EntityFolder folder = (op.folder == null ? null : db.folder().getFolder(op.folder)); + size += write(os, String.format("%s %s/%s %d %s/%d %s %s %s\r\n", TF.format(op.created), + account == null ? null : account.name, + folder == null ? null : folder.name, op.message == null ? -1 : op.message, op.name, op.tries, op.args, op.state, op.error)); + } } db.attachment().setDownloaded(attachment.id, size);