1.2.0 ⢠Published 12 months ago
logger-easy v1.2.0
logger-easy
logger-easy is a powerful and flexible logging tool for Node.js that enhances your development experience with colorized output and customizable log formatting.
š Features
- Colorized Output: Enjoy vibrant and easy-to-read logs with color-coded levels.
- Customizable Logging: Toggle timestamps and log levels to fit your needs.
- Multiple Log Levels: Log messages with
error
,warn
,info
,debug
, andsuccess
levels.
š¦ Installation
Easily install the package via npm:
npm i logger-easy
š Usage
Integrate the logger into your project with minimal setup:
import createLogger from "logger-easy";
//Default logger with no timestamps or log levels
const logger = createLogger('debug');
// Log messages
logger.info('This is an info message');
logger.debug('This is a debug message');
logger.warn('This is a warning message');
logger.error('This is an error message');
logger.success('This is a success message');
// Logger with timestamps and log levels
const loggerWithDetails = createLogger('debug', { includeTimestamp: true, includeLevel: true });
loggerWithDetails.info('This message includes timestamp and log level');
āļø Configuration
Customize your logging experience:
includeTimestamp: Add timestamps to log messages (default: false).
includeLevel: Include log levels in messages (default: false).
const logger = createLogger('info', { includeTimestamp: true, includeLevel: true });
š Get Started
Whether you're debugging complex applications or simply want a clear and colorful log output, My Logger Package provides the flexibility and ease-of-use to streamline your development workflow.
š License
MIT License. See the LICENSE file for details.
š¤ Contributing
We welcome contributions!
š§āš» Author
Abreham Tilahun