@kadoresmi00/logger

1.0.1 • Public • Published

@kadoresmi00/logger

More organized logs, conveniences, and colors!

npm i @kadoresmi00/logger

GitHub package.json version npm

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()

Only console outputs.

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()

Only console hex color usage.

const { Logger } = require('@kadoresmi00/logger');

const logger = new Logger();

logger.logWithHex('This is a hex message', '#ff0000');

NPM

Link

Package Sidebar

Install

npm i @kadoresmi00/logger

Weekly Downloads

3

Version

1.0.1

License

ISC

Unpacked Size

9.53 kB

Total Files

6

Last publish

Collaborators

  • kadoresmi00