auto-debug
Uses debug but automatically assumes filenames as the log namespace. Optionally logs line numbers, function arguments, and caller location.
Usage
debug(/* args */)
// lib/example.jsvar debug = ; module { ; // this line 5 /* prints: lib/example.js:5 someFunction hello */ /* equivalent to require('debug')('lib/example.js')(':5 someFunction hello') */};
debug.trace()
// lib/example2.jsvar debug = ;processenvDEBUG_TRACE = 'true'; // since debug trace can be noisey it only prints when DEBUG_TRACE is not set { debug; // this line 5 /* prints: lib/example2.js:5 add hello { a:10, b:20, c:30} from main lib/example2.js:16 */ /* equivalent to require('debug')('lib/example2.js')(':5 add hello { a:10, b:20, c:30} from main lib/example2.js:16') */}; { // line 16}
License
MIT