@amphibian/logger

2.1.3 • Public • Published

logger

build status

pretty, extendable logs

npm install @amphibian/logger
var chalk = require('chalk');
var {createLogger, timeLogger} = require('@amphibian/logger');

timeLogger.log('hello'); // > [2017-04-29T11:15:32.596Z] › hello

// Create your own logs
var logger = createLogger(() => (
    chalk.grey('[my-project]')
));

logger.log('Something!'); // > [my-project] › Something!

// Extend logs
var helloLogger = timeLogger.extend('hello');
helloLogger.log('you!'); // > [2017-04-29T11:15:32.596Z] hello › you

// Disable/enable logs
helloLogger.disable();
helloLogger.log('something'); // (nothing)
helloLogger.extend('you').log('there'); // (nothing)
helloLogger.enable();
helloLogger.log('hello!');

Readme

Keywords

none

Package Sidebar

Install

npm i @amphibian/logger

Weekly Downloads

9

Version

2.1.3

License

ISC

Unpacked Size

209 kB

Total Files

7

Last publish

Collaborators

  • thomaslindstr_m