1.0.2 • Published 2 years ago
@moustaouisalah/smart-logger v1.0.2
@moustaouisalah/smart-logger
@moustaouisalah/smart-logger is a smart logging package for JavaScript applications.
Example
Installation
You can install the package via npm:
npm install @moustaouisalah/smart-loggerUSAGE
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 messageinfo: Informational messagewarningorwarn: Warning messageerror: Error messagecritical: 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
name: Salaheddine Moustaouiemail: moustaoui.salaheddine@gmail.comgithub: moustaouiSalaheddinelinkedin: SALAHEDDINE MOUSTAOUIlocation: Morocco