A simple and lightweight logger.
npm install -D @sdanialraza/logger
yarn add -D @sdanialraza/logger
pnpm add -D @sdanialraza/logger
bun add -D @sdanialraza/logger
// CommonJS
const { Logger } = require('@sdanialraza/logger');
// ES Modules
import { Logger } from '@sdanialraza/logger';
const logger = new Logger();
// Using your logger instance
logger.critical('Hello, world!');
logger.debug('Hello, world!');
logger.error('Hello, world!');
logger.log('Hello, world!');
logger.info('Hello, world!');
logger.warn('Hello, world!');
// Passing in options
logger.log('Hello, world!', {
logsFilePath: "test.log",
timestamp: {
hour: "numeric",
minute: "numeric",
second: "numeric",
}
});
// Using static methods
Logger.critical('Hello, world!');
Logger.debug('Hello, world!');
Logger.error('Hello, world!');
Logger.log('Hello, world!');
Logger.info('Hello, world!');
Logger.warn('Hello, world!');
Pull requests are welcome, and very much appreciated. But before you start working on a pull request, please make sure to open an issue first, so that we can discuss the changes you want to make.
This project is licensed under the MIT License.