This is a customizable logger module built using Winston for logging functionality. It allows you to configure logging levels and customize log messages.
To install this logger module, run the following command:
npm install @oqzx/logger-utilsconst createLogger = require('@oqzx/logger-utils');
// Create logger instance with default configuration
const logger = createLogger();
logger.debug('Server', 'Debug message');
logger.info('API', 'Info message');
logger.warn('Client', 'Warning message');
logger.error('Host', 'Error message');You can pass configuration options to customize the logger behavior:
debug: Whether to log debug messages. Default istrue.info: Whether to log info messages. Default istrue.warn: Whether to log warning messages. Default istrue.error: Whether to log error messages. Default istrue.
Example:
// Create logger instance with custom configuration
const logger = createLogger({ debug: true, info: true, warn: false, error: true });The logger uses the following format for log messages:
[date] | [time] | [level] | [type]: [message]
date: Date when the log message was generated.timestamp: Time when the log message was generated.level: Log level (DEBUG, INFO, WARN, ERROR).type: Type of log message.message: Log message content.
This project is licensed under the MIT License - see the LICENSE file for details.
