modernlog
v1.1.0
Published
A logger that logs to console.log with date and stacktrace
Downloads
460
Readme
modernlog
Usage
const logger = require("modernlog/patch");
console.log("e"); // modern
OR, if you don't want to patch the console object
const logger = require("modernlog");
logger.log("e"); // modern
OR, if you want to patch the console object but revert the changes
const logger = require("modernlog/patch");
console.log("e"); // modern
logger.unpatch();
console.log("e"); // normal
logger.patch();
console.log("e"); // modern
Options
Applies to logger.*
and console.*
if patched.
logger.log("e"); // modern
logger.options.filename = true;
logger.log("e"); // modern with caller file name
logger.options.extraSpaces = 1;
logger.log("e"); // modern with one newline at the end
logger.options.filename = true;
logger.options.extraSpaces = 1337420;
logger.options.ignoreOptions = true;
logger.log("e"); // modern