Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/cut0x/node-logger-simple
- Owner: Cut0x
- Created: 2023-11-17T18:17:58.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-19T16:05:12.000Z (7 months ago)
- Last Synced: 2024-12-02T14:08:51.675Z (2 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/node-logger-simple
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.