the debug module by default creates the ^$ regexp which is unnecessary, harmful, and makes things run slower.
Test case:
var mod = require('..');
var debug = mod('tes');
debug('x1');
var debug2 = mod('');
debug2('x2');
(process.env.DEBUG || '')
.split(/[\s,]+/)
.forEach(function(name){
name = name.replace('*', '.*?');
console.log('^' + name + '$');
});
Output:
wicked@wicked-desktop:~/debug$ node example/test2.js
x2 +0ms
^$
Consider there's no DEBUG env in the call.
the debug module by default creates the ^$ regexp which is unnecessary, harmful, and makes things run slower.
Test case:
Output:
Consider there's no DEBUG env in the call.