@kadoresmi00/logger
v1.0.1
Published
It allows logging in the local folder.
Downloads
7
Maintainers
Readme
More organized logs, conveniences, and colors!
npm i @kadoresmi00/logger
Features:
- Easy error handling, updating, and detailed logging ✅
- Convenience and color in console logs ✅
- Console outputs in hex format ✅
- Console outputs with timestamp ✅
- Localized log outputs ✅
Usage
You can make improvements with the following examples 🧑💻
- It creates a 'logs' folder in the current directory and writes data on a monthly or daily basis according to your preferences.
const { Logger } = require('@kadoresmi00/logger');
const logger = new Logger({
frequency: 'monthly', // daily or monthly
consoleLog: true, // true or false
logLevel: 'debug', // error, warn, info, or debug
});
logger.log('This is an error message', 'error');
// [19:16:29] [ERROR] This is an error message
- logWithColor()
const { Logger } = require('@kadoresmi00/logger');
const logger = new Logger();
logger.logWithColor('This is a red message', 'red');
logger.logWithColor('This is a yellow message', 'yellow');
logger.logWithColor('This is a green message', 'green');
logger.logWithColor('This is a blue message', 'blue');
logger.logWithColor('This is a black message', 'black');
// black, red, green, yellow, blue, magenta, cyan, white, gray, brightRed, brightGreen, brightYellow, brightBlue, brightMagenta, brightCyan, brightWhite, purple, orange, teal, pink, lavender, reset
- logWithHex()
const { Logger } = require('@kadoresmi00/logger');
const logger = new Logger();
logger.logWithHex('This is a hex message', '#ff0000');