logger update

This commit is contained in:
Hri7566 2022-06-18 00:44:02 -04:00
parent 91ad68084c
commit 3f79a819d3
1 changed files with 4 additions and 4 deletions

View File

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