Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yodalightsabr/stumpjs
Better logging for Node.js
https://github.com/yodalightsabr/stumpjs
Last synced: 16 days ago
JSON representation
Better logging for Node.js
- Host: GitHub
- URL: https://github.com/yodalightsabr/stumpjs
- Owner: YodaLightsabr
- Created: 2021-10-14T03:28:22.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2021-10-14T03:52:58.000Z (about 3 years ago)
- Last Synced: 2024-10-11T11:49:28.730Z (about 1 month ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Stump.js
Stump.js gives you more control of the data logged to the console. You can easily toggle debug messages and verbose messages on and off, as well as locate error messages faster.## Code example
Code:
![Code example](https://media.discordapp.net/attachments/898047385211637790/898047393205981234/unknown.png)
Output:
![Output example](https://cdn.discordapp.com/attachments/898047385211637790/898047932505399337/unknown.png)## Logging to a Discord webhook
Setting up a Discord channel with a webhook is a great way to save logs in a searchable format for free.Code:
![Code example](https://cdn.discordapp.com/attachments/898047385211637790/898048539547037706/unknown.png)
Output:
![Output example](https://cdn.discordapp.com/attachments/898047385211637790/898048753402011698/unknown.png)## Usage
The `Stump` class is invoked with two arguments: features and settings. The `Debug` feature enables the `debug` and `verbose` log messages. The `Discord` feature enables posting to a Discord webhook and requires the `webhook` parameter in the settings object.To enable timestamps, add the `Timestamp` feature.
Output:
![Output example](https://cdn.discordapp.com/attachments/898047385211637790/898055553383825478/unknown.png)### Logging methods:
- `.info()`
- `.success()`
- `.warn()`
- `.error()`
- `.verbose()`
- `.debug()`