elu-async-logger
v1.0.1
Published
This package makes use of setImmediate or process.nextTick to ensure that the logging operation is non-blocking and takes advantage of the event loop's asynchronous nature.
Downloads
7
Readme
AsyncLogger
AsyncLogger is a Node.js package designed to log messages asynchronously, improving application performance by reducing the time spent on logging operations. It supports advanced features such as custom log formatting, log buffering, timestamp customization, and more.
Features
- Asynchronous Logging: Non-blocking log operations to improve performance.(Live)
- Custom Log Formatting: Define your own log message formats.(upcoming)
- Log Buffering and Flushing: Buffer log messages and flush them periodically.(Live)
- Timestamp Formatting: Customize the format of timestamps in your logs.(Upcoming)
- Log Rotation: Automatically rotate log files to manage file sizes.(upcoming)
- Environment-Based Logging: Adjust logging behavior based on the environment (e.g., development, production).(upcoming)
- Rate Limiting: Limit the rate at which logs are processed to avoid overwhelming the output.(Live)
- Tagging Logs: Support tagging log messages for better categorization and filtering.(Upcoming)
Installation
npm install async-logger
## Basic Usage
const AsyncLogger = require('async-logger');
const logger = new AsyncLogger();
logger.asyncLog('This is an info message');
logger.asyncLog('This is a warning message', 'warn');
logger.asyncLog(new Error('This is an error message'), 'error');