Yadsil
Yet another dead-simple log, on stderr, for CLI tools. Only when on a TTY,
enable colors. Only when not on a TTY, prefix each output with the CLI tool
name. Possibility to reactivate colors when not on a TTY (it's up to
you to provide a --color
option or something). That's all.
Install
$ npm install yadsil --save
Usage
log = require('yadsil')('my-tool-name');
log.verbose(true);
log.color(true);
log.fatal(1, 'exit with %s', 'one');
log.error('foo');
log.warning('bar')
log.notice('baz');
log.info('dru');
log.debug('waf');
That's all.
Limitations
No log levels, no fancy features, not timestamps. Just the bare minimum on top
of stderr, and will stay that way.
Contribute
Feel free to fork and submit pull requests.