Skip to content
This repository has been archived by the owner on Sep 11, 2022. It is now read-only.
/ colored-logs Public archive

Simple yet elegant logger for your node.js application.

License

Notifications You must be signed in to change notification settings

zakuciael/colored-logs

Repository files navigation

Colored Logs

npm npm

Simple yet elegant logger for your node.js application.

Installation

Using Yarn

yarn add colored-logs

Using NPM

npm install colored-logs

Usage

Basic

const {Logger} = require("colored-logs");

Logger.info("This is a info message.");
Logger.debug("Secret stuff hidden from users.");
Logger.warn("This is a test warn message.");
Logger.error(new Error(`Little Error`), "looking on this error");

With Custom Options

const {Logger} = require("colored-logs");
new Logger({
    level: "info",
    filePath: "./path/to/file.log"
});

Logger.info("This is a info message.");
Logger.debug("Secret stuff hidden from users.");
Logger.warn("This is a test warn message.");
Logger.error(new Error(`Little Error`), "looking on this error");

Configuration Options

  • LoggerOptions: Configures logger to fit your needs. Possible values:
    • level - Logging levels conform to the severity ordering specified by "from most important to least important"
    • filePath - Path to a file in which logs will appear
    • timezone - Controls timezone that is used across the Logger
    • timed_logs - If enabled and filePath is not set creates a log file with time of the first log.

Output Example

Output Screenshot

About

Simple yet elegant logger for your node.js application.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published