GeoTIFF / georaster-layer-for-leaflet

Display GeoTIFFs and soon other types of raster on your Leaflet Map
https://geotiff.github.io/georaster-layer-for-leaflet-example/
Apache License 2.0
306 stars 58 forks source link

Default global debugLevel to 0 in production #57

Closed Rennzie closed 3 years ago

Rennzie commented 3 years ago

When in production its a good idea to silence the debug level by default as the extra console logs would degrade performance and obscures other logging (errors etc). By having a good default setup it improves the DX of the lib.

Add a const isProduction = process.env.NODE_ENV === 'production' to the top of georaster-layer-for-leaflet.js and then default the global debugLevel depending on it: if (!("debugLevel" in options)) options.debugLevel = isProduction ? 0 : 1;

DanielJDufour commented 3 years ago

Love it!