@john-yuan/dev-simple-logger

1.0.1 • Public • Published

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);

Readme

Keywords

Package Sidebar

Install

npm i @john-yuan/dev-simple-logger

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

3.33 kB

Total Files

5

Last publish

Collaborators

  • john-yuan