1.0.1 • Published 5 years ago
@john-yuan/dev-simple-logger v1.0.1
Simple Logger
A simple logger that write log to the console with time and colors.
Install
This module is published to NPM, you can install it with the following command:
npm i @john-yuan/dev-simple-logger
API
/**
* Like console.log(), no color and time will be applied
*
* @param {string} [message]
* @returns {this}
*/
logger.log(message);
/**
* Print the info message with the current time in green color
*
* @param {string} [message]
* @returns {this}
*/
logger.info(message);
/**
* Print the warning message with the current time in yellow color
*
* @param {string} [message]
* @returns {this}
*/
logger.warn(message);
/**
* Print the error message in red color. Empty lines will be prepended and appended.
*
* @param {string} [message]
* @returns {this}
*/
logger.error(message);