Configurable JavaScript logger.
$ yarn add chuchote
chuchote
expose a createLogger
function which allows you to create a personalized logger.
const chuchote = require("chuchote");
const log = chuchote.createLogger({
filterLevel:
process.env.NODE_ENV === "production"
? chuchote.logLevel.OFF
: chuchote.logLevel.INFO,
handler: (messages, { level }) => {
console.log(`${level.name}: ${messages[0]}`);
}
});
log.error("You made a mistake");