dslog.js
v1.0.3
Published
an extensible structured logging library with discord webhook support
Readme
dslog
an extensible structured logging library with discord webhook support
install
npm install dslog.js
roadmap
- custom embed support
- pipe to log file
configuration
all config goes into dslog.config.json in the project root
{
"webhookUrl": "discord wh url"
}OR
{
"webhooks": ["wh url 1", "wh url 2"]
}usage
import
const dslog = require("dslog");all log levels
dslog.OK;
dslog.WARN;
dslog.ERROR;
dslog.INFO;basic slog
dslog.log(dslog.INFO, "log message");no date
dslog.log(dslog.INFO, "log message", {
showDate: false,
});additional objects
dslog.log(dslog.INFO, "log message", {
objects: [{ value: 1 }, { value: 2 }],
prettyPrint: false, // toggle on if you want indents
});