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: 4 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 (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-08T17:23:50.000Z (4 months ago)
- Last Synced: 2025-03-18T06:37:58.562Z (4 months ago)
- Language: JavaScript
- Homepage: https://node-ls.app/
- Size: 25.4 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
```[x] Head to [node-ls.app](https://node-ls.app/) to retrieve the required information, and to view the logs.
# ✏️ Usage
```js
const { Logger } = require('node-logger-simple');const logger = new Logger({
app_id: 'app_CODE', // https://panel.node-ls.app/
api_key: 'API_KEY', // https://panel.node-ls.app/
});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.