dslog.js

1.0.3 • Public • Published

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
});

Readme

Keywords

none

Package Sidebar

Install

npm i dslog.js

Weekly Downloads

1

Version

1.0.3

License

ISC

Unpacked Size

5.88 kB

Total Files

4

Last publish

Collaborators

  • ferretcode