Console
Formatted console output for Node.
Usage
const logger = require('@frctl/console')('My App');
logger.log('Plain log output');
logger.success('The operation was successful');
logger.warn('You might want to consider this');
logger.error(new Error('An error with a stack'));
logger.debug('This will only show if the DEBUG environment variable is set');
Run with the DEBUG
environment variable set to print Error
stacks and .debug()
output to the console, plus prefix output with the provided namespace.
DEBUG=true node myapp.js
Install
Installation using Yarn is recommended.
yarn add @frctl/console
Requirements
@frctl/console
requires Node >= v6.0