Skip to content

Cut0x/node-logger-simple

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Logger Module

A simple Node.Js module with configurable options.

📥 Installation

npm install node-logger-simple

✏️ Usage

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

// personalised file is required
const logger = new FileLogger({
  logFilePath: "my-log-file"
});

logger.logError('An error has occurred.');
logger.logInfo('Important information.');
logger.logSucces('Succes message.')

📣 Options

Initialize the Logger with the following options:

  • logFilePath : Allows you to choose the file name.

📜 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.