commit 0cd1b1fb08c2f36f7ec9c05f5f81034556ecb1ef
parent 062ee0a4b706ead53a794e9ab9d87c47731e7e5b
Author: Sergej Orlov <wladimirych@gmail.com>
Date: Sat, 15 Dec 2018 13:04:46 +0100
[jnx] log start and end of making jnx
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/lib/leaflet.control.jnx/index.js b/src/lib/leaflet.control.jnx/index.js
@@ -89,10 +89,16 @@ L.Control.JNX = L.Control.extend({
const bounds = this._selector.getBounds();
const sanitizedLayerName = layerName.toLowerCase().replace(/[ ()]+/, '_');
const fileName = `nakarte.me_${sanitizedLayerName}_z${zoom}.jnx`;
+ const eventId = logging.randId();
+ logging.logEvent('jnx start', {eventId, layerName, zoom, bounds});
makeJnxFromLayer(layer, layerName, zoom, bounds, this.notifyProgress.bind(this))
- .then((fileData) => saveAs(fileData, fileName, true))
+ .then((fileData) => {
+ saveAs(fileData, fileName, true);
+ logging.logEvent('jnx end', {eventId, success: true});
+ })
.catch((e) => {
logging.captureException(e);
+ logging.logEvent('jnx end', {eventId, success: false, error: e.stack});
notify(`Failed to create JNX: ${e.message}`);
}
)