0.9.11 • Published 1 year ago

@vlodia/logger v0.9.11

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

@vlodia/logger

A simple Node.js logger class for printing colorful console logs using the chalk module. It supports various log levels with color-coded messages.

Installation

To install the module using npm, run the following command in your terminal:

npm install @vlodia/logger
yarn add @vlodia/logger

Usage

const { Logger } = require("@vlodia/logger");

// Create an instance of Logger
const logger = new Logger("MyApp");

// Print log messages
logger.log("This is a log message.");
logger.info("This is an info message.");
logger.warn("This is a warning message.");
logger.error("This is an error message.");
logger.success("This is a success message.");

Termianl

Log Levels

  • log(message: string): General log messages.
  • info(message: string): Information messages.
  • warn(message: string): Warning messages.
  • error(message: string): Error messages.
  • success(message: string): Success messages.
  • Log messages are printed to the console with timestamp and a custom prefix in colorful format.

Example

const express = require("express");
const app = express();
const { Logger } = require('@vlodia/logger');
const logger = new Logger('APP:')
app.get("/", (req, res) => res.send("Express"));

app.listen(3000, () => {
    logger.success("Connected succesfully")
});

module.exports = app;
  • It will look like this in the terminal

Terminal

Contributing

  • This module is open source. You can contribute by adding new features or fixing bugs and sending a pull request to the GitHub repository.

License

  • This project is licensed under the Apache-v2.0 License. For details, see the LICENSE file.
0.9.11

1 year ago

0.9.4

1 year ago

0.9.3

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago