1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-13 10:02:24 +03:00
Files
node-redis/lib/debug.js
2017-05-28 05:23:21 +02:00

19 lines
343 B
JavaScript

'use strict'
var index = {
debugMode: /\bredis\b/i.test(process.env.NODE_DEBUG)
}
// Lazy load the main file
process.nextTick(() => (index = require('../')))
/**
* @description Print a debug statement if in debug mode
*/
function debug () {
if (index.debugMode) {
console.error.apply(null, arguments)
}
}
module.exports = debug