A simple, lightweight and beautiful console logger for Node.js
- Lightweight
- Easy to use
- Fully customizable
- Beautiful colors everywhere with chalk
Cutelog is available from the npm library:
$ npm i cutelog.js
The cutelog API is as simple as it gets:
const log = require('cutelog.js')
const chalk = require('chalk')
// Out of the box, you get four log levels:
log.info("An informative message");
log.okay("Yay, it worked!");
log.warn("Maybe you should look into this");
log.error("Something bad happened");
// Any log level can be restyled:
log.configure('error', chalk.keyword('orange'));
log.error("Something bad happened, but in orange");
// And you can even define your own log levels:
log.configure('cat', chalk.keyword('magenta'))
log.custom('cat', "Nyan ~");
// You can also define completely custom formatters:
function formatter(input) {
return `[ ${chalk.yellow(input)} ]`;
}
log.configure('info', formatter);
log.info("A custom formatted info message.");