2.1.0 • Published 5 years ago

@emit-js/log v2.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

@emit-js/log

emit logger

log

Install

npm install @emit-js/emit @emit-js/log

Setup

import { Emit } from "@emit-js/emit"
import { log } from "@emit-js/log"

const emit = new Emit()
log(emit)

Log levels

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

By default, the logger only logs messages at log level info or above, but you can change that:

emit.logLevel(null, "debug")

You could also set the environment variable LOG=debug.

Logs all events

By default, the logger logs all events at log level debug.

Change the log level to info for certain events:

emit.logLevel("myEvent", "info")

Manual logging

All of these work:

emit.log(null, "log message at log level info")
emit.log(null, "warn", "warning!")
emit.log(["event", "ids"])
2.1.0

5 years ago

2.0.8

5 years ago

2.0.7

5 years ago

2.0.6

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.40

5 years ago

1.0.38

5 years ago

1.0.37

5 years ago

1.0.36

5 years ago

1.0.35

5 years ago

1.0.34

5 years ago