A Configurable, Useful Way to Write Debug Log Statements
// index.js
#!/usr/bin/env node
import { DebugLogger } from "@WillKM/DL";
const debug = new DebugLogger({
enabled: true,
logLevel: 1,
prefixMessage: '[DebugLogger] -'
});
debug.log(1, "Hello World");
$ node index.js
> [DebugLogger] - Hello World
I made this as I wanted to regulate what logs showed when providing different verbosity levels.