Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cut0x/node-logger-simple

A simple Node.Js logger module with configurable options.
https://github.com/cut0x/node-logger-simple

Last synced: about 2 months ago
JSON representation

A simple Node.Js logger module with configurable options.

Awesome Lists containing this project

README

        

# Logger Module
A simple Node.Js module with configurable options.

# 📥 Installation
```bash
npm install node-logger-simple
```

# ✏️ Usage
```js
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.