@moustaouisalah/smart-logger is a smart logging package for JavaScript applications.
You can install the package via npm:
npm install @moustaouisalah/smart-logger
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');
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');
The logger supports the following log levels:
-
log
: General log message -
info
: Informational message -
warning
orwarn
: 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)
This package is open-source and licensed under the MIT License.
-
name
: Salaheddine Moustaoui -
email
: moustaoui.salaheddine@gmail.com -
github
: moustaouiSalaheddine -
linkedin
: SALAHEDDINE MOUSTAOUI -
location
: Morocco