fancy-log but with colors!
Uses fancy-log and colors to create time-stamped, colored, and (optionally) named loggers.
Using npm
:
npm i --save @fizzygalacticus/colored-fancy-log
Using yarn
:
yarn add --save @fizzygalacticus/colored-fancy-log
By default, colored-fancy-log exports a logger with no name to be used immediately:
const logger = require('@fizzygalacticus/colored-fancy-log');
logger.success('Hello, world!');
Output:
To name a logger:
const { getLogger } = require('@fizzygalacticus/colored-fancy-log');
const logger = getLogger({ name: 'test-logger' });
logger.success('Hello, world!');
Output:
Don't like the default name <-> message separator? You can change that too!
const { getLogger } = require('@fizzygalacticus/colored-fancy-log');
const logger = getLogger({ name: 'test-logger', separator: '=>' });
logger.success('Hello, world!');
Output: