@dot-event/log

1.0.34 • Public • Published

@dot-event/log

dot-event logger

dots

Install

npm install dot-event @dot-event/log

Setup

Add the logger right after you initialize your dot-event instance:

const dot = require("dot-event")()
require("@dot-event/log")(dot)

This creates the dot.log emitter.

Log levels

There are five log levels: debug, trace, info, warn, and error.

By default, the logger only logs info or above, but you can change that with logLevel:

dot("logLevel", { arg: "debug" })

Automatic logging

By default, the logger logs any and all events at log level info.

If your event is very noisy, you might want to opt to alias info logs to debug for that particular event:

dot("logLevel", "myEvent", { info: "debug" })

Manual logging

dot.log("warn", { arg: "some scary message here" })

Readme

Keywords

Package Sidebar

Install

npm i @dot-event/log

Weekly Downloads

1

Version

1.0.34

License

MIT

Unpacked Size

6.33 kB

Total Files

7

Last publish

Collaborators

  • winton