cclog ccinfo ccerr ccwarn

This commit is contained in:
陆柯 2022-03-11 12:01:58 +08:00
parent cfb66c3eec
commit 6822930e78

View File

@ -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)
},
}