From 6822930e787f2d745cacd3bf2fe0a10139a7065b Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Fri, 11 Mar 2022 12:01:58 +0800 Subject: [PATCH] cclog ccinfo ccerr ccwarn --- tool4log.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tool4log.js b/tool4log.js index e70dcc2..8252459 100644 --- a/tool4log.js +++ b/tool4log.js @@ -1,7 +1,16 @@ const colors = require('colors') module.exports = { - colog(...args) { + cclog(...args) { console.log(colors.green({time: new Date().toJSON()}), ...args) - } + }, + ccinfo(...args) { + console.info(colors.blue({time: new Date().toJSON()}), ...args) + }, + ccerr(...args) { // console.error will appear in pm2's error log + console.error(colors.red({time: new Date().toJSON()}), ...args) + }, + ccwarn(...args) { // console.warn will appear in pm2's error log + console.warn(colors.yellow({time: new Date().toJSON()}), ...args) + }, }