UNPKG

log-with-statusbar

Version:

A light weight logger with a status bar on the bottom or the top that does not disappear with scrolling

20 lines (16 loc) 719 B
var log = require("../index.js")({ maxVerbosity: 1, //Minimum verbosity level verbosity: 1, //Default verbosity level enableStatusBar: false }); // We only print if verbosity is less than or equal maxVerbosity // Non-verbose mode. The lines with verbosity 2 and 3 won't print log("This prints because (1 <= 1)= true"); log.verbosity(2).info("Less important line 1"); log.verbosity(3).info("Even less important line 2"); console.log("\nLet's be more verbose!\n"); // Let's be more verbose. The lines with verbosity 2 and 3 won't print log = log.maxVerbosity(3); log("This prints because (1 <= 3)= true"); log.verbosity(2).info("Less important line 1"); log.verbosity(3).info("Even less important line 2");