UNPKG

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
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, }