@moustaouisalah/smart-logger

1.0.2 • Public • Published

@moustaouisalah/smart-logger

npm version License

@moustaouisalah/smart-logger is a smart logging package for JavaScript applications.

Example

Screenshot 2024-05-02 at 15 17 51

Installation

You can install the package via npm:

npm install @moustaouisalah/smart-logger

USAGE

Using import

import logger from '@moustaouisalah/smart-logger';

logger.log('This is a log message');
logger.info('This is an informational message');
logger.warning('This is a warning message');
logger.error('This is an error message');
logger.critical('This is a critical message');

Using require

const logger = require('@moustaouisalah/smart-logger');

logger.log('This is a log message');
logger.info('This is an informational message');
logger.warning('This is a warning message');
logger.error('This is an error message');
logger.critical('This is a critical message');

Log Levels

The logger supports the following log levels:

  • log: General log message
  • info: Informational message
  • warning or warn: Warning message
  • error: Error message
  • critical: Critical error message

In addition, the logger also supports the following levels with specific styling:

  • debug: Debug message (styled with '\x1b[37m' - yellow)
  • exception: Exception message (styled with '\x1b[31m' - red)
  • success: Success message (styled with '\x1b[32m' - green)
  • dir: Directory message (styled with '\x1b[34m' - blue)

License

This package is open-source and licensed under the MIT License.

Author

Package Sidebar

Install

npm i @moustaouisalah/smart-logger

Weekly Downloads

3

Version

1.0.2

License

MIT

Unpacked Size

7.81 kB

Total Files

4

Last publish

Collaborators

  • moustaouisalah