forked from Hri7566/mpp-server-dev2
logger update
This commit is contained in:
parent
91ad68084c
commit
3f79a819d3
|
@ -6,20 +6,20 @@ class Logger {
|
|||
}
|
||||
|
||||
log(args) {
|
||||
console.log(chalk.green(`[${this.context}]`), args);
|
||||
console.log(chalk.green(`[`) + chalk.green(`${this.context}`) + chalk.green(`]`), args);
|
||||
}
|
||||
|
||||
warn(args) {
|
||||
console.warn(chalk.yellow(`[WARN] [${this.context}]`), args);
|
||||
console.warn(chalk.yellow(`[WARN] [`) + chalk.yellow(`${this.context}`) + chalk.yellow(`]`), args);
|
||||
}
|
||||
|
||||
error(args) {
|
||||
console.error(chalk.red(`[ERR] [${this.context}]`), args);
|
||||
console.error(chalk.red(`[ERR] [`) + chalk.red(`${this.context}`) + chalk.red(`]`), args);
|
||||
}
|
||||
|
||||
debug(args) {
|
||||
if (process.env.DEBUG_ENABLED) {
|
||||
console.log(chalk.blue(`[DEBUG] [${this.context}]`), args);
|
||||
console.log(chalk.blue(`[DEBUG] [`) + chalk.blue(`${this.context}`) + chalk.blue(`]`), args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue