Skip to content

Cut0x/node-logger-simple

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Logger Module

A simple Node.Js module with configurable options.

📥 Installation

npm install node-logger-simple

[x] Head to nodels.valloic.dev to retrieve the required information, and to view the logs.

✏️ Usage

const { Logger } = require('node-logger-simple');

const logger = new Logger({
  app_id: 'app_CODE', // https://node-ls.valloic.dev/app.php
  api_key: 'API_KEY', // https://node-ls.valloic.dev/app.php
});

async function runTests() {
  try {
    await logger.logInfo("Info test from test.js");

    await logger.logError("Error test from test.js");

    await logger.logSucces("Success test from test.js");
  } catch (err) {
    console.error("An error occurred during the tests:", err);
  }
}

runTests();

// Or just
logger.logSucces("Success test from test.js");

📣 Options

Initialize the Logger with the following options:

  • app_id : Your application ID (required).
  • api_key: Your application key (required).

📜 Methods

  • logError('An error has occurred.') - Logs an error message to the configured log file.
  • logSucces('Succes message.') - Logs an succes message to the configured log file.
  • logInfo('Important information.') - Logs an info message to the configured log file.

About

A simple Node.Js logger module with configurable options.

Resources

Stars

Watchers

Forks