@wedevultrex/lumia
v1.0.4
Published
A versatile logger for Node.js
Downloads
1
Readme
Lumia
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
});