123456789101112131415161718192021222324252627282930313233343536 |
- // Logging utility
- const chalk = require('chalk')
- class Log {
- info(message) {
- console.log(
- chalk.bgWhite.black(" INFO "),
- message.replace(/\n/g, '\n ')
- )
- }
- ok(message) {
- console.log(
- chalk.bgGreen.black(" OK "),
- chalk.green(message.replace(/\n/g, '\n '))
- )
- }
- warning(message) {
- console.log(
- chalk.bgYellow.black(" WARN "),
- chalk.yellow(message.replace(/\n/g, '\n '))
- )
- }
- critical(message) {
- console.log(
- chalk.bgRed.white(" CRIT "),
- chalk.red(message.replace(/\n/g, '\n '))
- )
- }
- }
- module.exports = Log
|