Socket
Book a DemoInstallSign in
Socket

colored-logging

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

colored-logging

colored logging

latest
Source
npmnpm
Version
0.0.9
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Logger

A simple logger utility for logging messages with different log levels.

Installation

To install the Logger package, run the following command:

npm install logger

Usage

Here is an example of how to use the Logger class:

const Logger = require('logger');

// Create a new instance of the Logger
const logger = new Logger('MyProject');

// Log an informational message
logger.info('This is an informational message.');

// Log a warning message
logger.warn('This is a warning message.');

// Log an error message
logger.error('This is an error message.');

// Log a message with additional data
const data = { key: 'value' };
logger.info('This is a message with additional data:', data);

API

Logger

The Logger class provides logging functionality with different log levels.

Constructor

new Logger(projectName: string): Creates a new instance of the Logger class with the specified projectName.

Methods

  • info(message: string, data?: any): void: Logs an informational message with an optional data object.
  • warn(message: string, data?: any): void: Logs a warning message with an optional data object.
  • error(message: string, data?: any): void: Logs an error message with an optional data object.

Installation

You can install the Logger package via npm:

npm install logger

Contributing

Contributions are welcome! Please feel free to submit a pull request.

License

This project is licensed under the ISC License.

Issues

If you encounter any issues or have any questions, please create an issue on the GitHub repository.

Versioning

This project follows the principles of Semantic Versioning.

Keywords

logger

FAQs

Package last updated on 27 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts