clog1801-pmb
v1.0.2
Published
Yet another console logger
Downloads
1
Readme
clog1801-pmb
Yet another console logger
Usage
from test.usage.js:
var makeLoggerFactory = require('clog1801-pmb'),
log = makeLoggerFactory({ verbosity: 'misc' });
equal(log.verbosity, log.levels.misc);
// The log factory carries methods for the log levels:
log.misc('Hello World');
equal(log.misc.isIgnore, false);
log.debug('beep');
equal(log.debug.isIgnore, true);
log.emrg('Emergency!!!1!!11!!!!');
equal(log.emrg.isIgnore, false);
// !! Caveat: !!
// Once created, log funcs maintain their verbosity:
log.verbosity = log.levels.debug;
equal(log.debug.isIgnore, true);
expectStdout([
'24:60:60 Hello World\n',
'24:60:60 Emergency!!!1!!11!!!!\n',
].join(''));
Known issues
- Needs more/better tests and docs.
License
ISC