logger-sri
v1.0.15
Published
A simple and customizable logging utility for Node.js
Maintainers
Readme
Logger Library
A simple, customizable logging utility for Node.js with colorized log levels.
Installation
You can install this package using NPM:
npm install logger-sriImport logger-sri
import Logger from 'logger-sri';OR
const Logger = require('logger-sri');Set name for each page
const logger = new Logger('app');Example of Full Usage:
Log different levels of messages
logger.log('This is a log message.');
logger.error('This is an error message.');
logger.warn('This is a warning.');
logger.debug('This is a debug message.');
logger.verbose('This is a verbose message.');
logger.fatal('This is a fatal message.');Output:
- [LOG] 2025-07-11T04:17:21.956Z [app]: This is a log message.
- [ERROR] 2025-07-11T04:17:21.956Z [app]: This is an error message.
- [WARN] 2025-07-11T04:17:21.956Z [app]: This is a warning.
- [DEBUG] 2025-07-11T04:17:21.956Z [app]: This is a debug message.
- [VERBOSE] 2025-07-11T04:17:21.956Z [app]: This is a verbose message.
- [FATAL] 2025-07-11T04:17:21.956Z [app]: This is a fatal message.
Key Features:
- Installation: Instructions on how to install the package with NPM.
- Usage: Detailed steps on how to import and use the
logger-srilibrary in your application. - Logging Levels: Instructions on how to log different levels of messages (
log,error,warn,debug,verbose,fatal). - Customization: Explanation of how to control which log levels are enabled using
setLogLevels.
This README.md should make it easier for users to understand how to use your library, providing clear installation, usage, and configuration instructions.
