node-whistleblower
v1.0.1
Published
A flexible logging utility.
Downloads
1
Readme
Whistleblower
A flexible logging utility
Usage
import { Logger, LogHandler, Loglevel } from "node-whistleblower"
const logger = new Logger(Loglevel.Info)
logger.createChannel("test")
logger.addHandler(new LogHandler())
logger.channel("test").info( // Supply as many arguments as you like
"Hello World",
1,
2,
3,
["a", "b", "c"],
{
x: 10,
y: 20,
z: 30,
},
new Set([1, 2, 3, 4, 5]),
new Map()
.set("a", 1)
.set("b", null)
.set(new Map().set("foo", "bar"), 3)
.set(Infinity, NaN)
.set(-Infinity, undefined)
)
// test.INFO: "Hello World" 1 2 3 ["a","b","c"] {"x":10,"y":20,"z":30} Set[1,2,3,4,5] Map{"a":1,"b":null,Map{"foo":"bar"}:3,Infinity:NaN,-Infinity:undefined}