commit 062ee0a4b706ead53a794e9ab9d87c47731e7e5b
parent 8db64f9cf2c214c844fb777bf08f2ddf9ca50e51
Author: Sergej Orlov <wladimirych@gmail.com>
Date: Sat, 15 Dec 2018 12:57:38 +0100
[print] log start and end of making pdf and jpg
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/src/lib/leaflet.control.printPages/control.js b/src/lib/leaflet.control.printPages/control.js
@@ -219,6 +219,8 @@ L.Control.PrintPages = L.Control.extend({
const scale = this.scale();
const width = this.pageWidth();
const height = this.pageHeight();
+ const eventId = logging.randId();
+ logging.logEvent('print pdf start', {eventId});
renderPages({
map: this._map,
pages,
@@ -238,10 +240,12 @@ L.Control.PrintPages = L.Control.extend({
extension: 'pdf'
});
savePagesPdf(images, resolution, fileName);
+ logging.logEvent('print pdf end', {eventId, success: true});
}
}
).catch((e) => {
logging.captureException(e);
+ logging.logEvent('print pdf end', {eventId, success: false, error: e.stack});
notify(`Failed to create PDF: ${e.message}`);
}
).then(() => this.makingPdf(false));
@@ -268,6 +272,8 @@ L.Control.PrintPages = L.Control.extend({
const scale = this.scale();
const width = this.pageWidth();
const height = this.pageHeight();
+ const eventId = logging.randId();
+ logging.logEvent('print jpg start', {eventId});
renderPages({
map: this._map,
pages,
@@ -287,9 +293,11 @@ L.Control.PrintPages = L.Control.extend({
extension: 'jpg'
});
savePageJpg(images[0], fileName);
+ logging.logEvent('print jpg end', {eventId, success: true});
})
.catch((e) => {
logging.captureException(e);
+ logging.logEvent('print jpg end', {eventId, success: false, error: e.stack});
notify(`Failed to create JPEG from page: ${e.message}`);
}
).then(() => this.makingPdf(false));