protoml-parser
Version:
ProtoML is a lightweight, declarative markup language designed for writing and structuring meeting protocols, notes and task lists in a human-readable and machine-parseable format.
30 lines (25 loc) âĸ 468 B
JavaScript
const LEVELS = {
error: 0,
info: 1,
debug: 2,
trace: 3,
}
let currentLevel = LEVELS.info
function setVerbosity(v) {
currentLevel = Math.min(v, 3)
}
function log(level, msg) {
if (LEVELS[level] <= currentLevel) {
const prefix = {
error: "â",
info: "âšī¸ ",
debug: "đ",
trace: "đ"
}[level] || ""
console.log(`${prefix} ${msg}`)
}
}
module.exports = {
log,
setVerbosity,
}