1.0.4 ⢠Published 6 months ago
quick-logger-js v1.0.4
quicklogger
š A NestJS-inspired TypeScript logger prioritizing blazing speed, performance, and simplicity.
Features
- ā”ļø High-performance logging
- šØ Colorized output
- šÆ TypeScript support
- ā±ļø Optional timestamps with time differences
- š Contextual logging
- š Multiple log levels
- š ļø Configurable and extensible
Installation
npm i quick-logger-js
Quick Start
import { QuickLogger } from 'quick-logger-js';
// Create a logger instance
const logger = new QuickLogger({
context: 'MyApp',
timestamp: true
});
// Basic logging
logger.log('Application started');
logger.info('Server running on port 3000');
logger.warn('Resource usage high');
logger.error('Connection failed');
Configuration
Log Levels
log
: Standard logserror
: Error messageswarn
: Warning messagesdebug
: Debug informationverbose
: Detailed informationfatal
: Critical errors
Context Usage
// Global context from constructor
const logger = new QuickLogger({ context: 'MyApp' });
// Per-message context
logger.log('User logged in', 'Auth');
logger.error('Database connection failed', 'Database');
Performance
quicklog
is designed for high-performance logging with:
- Minimal overhead
- Optimized string concatenation
- Efficient memory usage
- No unnecessary object allocations
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.