Expose libvips warnings via NODE_DEBUG env var

This commit is contained in:
Lovell Fuller
2017-04-05 23:01:39 +01:00
parent 46aec7eabc
commit 301bfbd271
8 changed files with 92 additions and 8 deletions

View File

@@ -24,6 +24,9 @@ let versions = {
} catch (err) {}
})();
// Use NODE_DEBUG=sharp to enable libvips warnings
const debuglog = util.debuglog('sharp');
/**
* @class Sharp
*
@@ -174,6 +177,8 @@ const Sharp = function (input, options) {
tiffSquash: false,
tileSize: 256,
tileOverlap: 0,
// Function to notify of libvips warnings
debuglog: debuglog,
// Function to notify of queue length changes
queueListener: function (queueLength) {
queue.emit('change', queueLength);