1.0.4 • Published 6 months ago

@wedevultrex/lumia v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

Lumia

NPM Version

A versatile logger for Node.js that allows you to log messages with different log levels and customize log colors.

Installation

You can install this package using npm:

npm install @wedevultrex/lumia

Usage

Example 1

const { Logger } = require("@wedevultrex/lumia");

const logger = new Logger({
  logLevels: {
    info: "blue",
    warning: "yellow",
    error: "red",
    custom: "green",
    debug: "cyan",
  },
  logToConsole: true,
  logToFile: "app.log", // Specify a log file path or set to null to disable file logging
});

logger.log("This is an informational message", "info");
logger.log("This is a warning message", "warning");
logger.log("This is an error message", "error");
logger.log("This is a custom log level message", "custom", "magenta"); // custom log level
logger.log("This is a debug message", "debug");

Example 2

const logger = new (require("@wedevultrex/lumia"))({
  logLevels: {
    info: "blue",
    warning: "yellow",
    error: "red",
    custom: "green",
    debug: "cyan",
  },
  logToConsole: true,
  logToFile: "app.log", // Specify a log file path or set to null to disable file logging
});
1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.0

6 months ago