From 5e0674b8425d0867407febf561f0808c2f77d0b8 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 30 Apr 2022 05:16:41 -0400 Subject: [PATCH] Add logging for PDF exports --- chrome/content/zotero/xpcom/pdfWorker/manager.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chrome/content/zotero/xpcom/pdfWorker/manager.js b/chrome/content/zotero/xpcom/pdfWorker/manager.js index 9a2d1be9d8..cb23029218 100644 --- a/chrome/content/zotero/xpcom/pdfWorker/manager.js +++ b/chrome/content/zotero/xpcom/pdfWorker/manager.js @@ -152,6 +152,8 @@ class PDFWorker { if (!attachment.isPDFAttachment()) { throw new Error('Item must be a PDF attachment'); } + let t = new Date(); + Zotero.debug(`Exporting PDF for item ${attachment.libraryKey}`); let items = attachment.getAnnotations(); items = items.filter(x => !x.annotationIsExternal); let annotations = []; @@ -200,6 +202,8 @@ class PDFWorker { await Zotero.Items.erase(items.map(x => x.id)); } + Zotero.debug(`Exported PDF with ${annotations.length} annotation(s) in ${new Date() - t} ms`); + return annotations.length; }, isPriority); }