1.0.2 • Published 1 year ago

@moustaouisalah/smart-logger v1.0.2

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

@moustaouisalah/smart-logger

npm version License

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

Example

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

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago