[mirotalk] - improve Logger
This commit is contained in:
+12
-3
@@ -91,7 +91,10 @@ module.exports = class Logger {
|
||||
* @returns
|
||||
*/
|
||||
info(msg, op = '') {
|
||||
console.info('[' + this.getDataTime() + '] [' + this.appName + '] ' + msg, util.inspect(op, options));
|
||||
console.info(
|
||||
'[' + this.getDataTime() + '] [' + this.appName + '] ' + Log.fg.green + msg + Log.ac.reset,
|
||||
util.inspect(op, options),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -101,7 +104,10 @@ module.exports = class Logger {
|
||||
* @returns
|
||||
*/
|
||||
warn(msg, op = '') {
|
||||
console.warn('[' + this.getDataTime() + '] [' + this.appName + '] ' + msg, util.inspect(op, options));
|
||||
console.info(
|
||||
'[' + this.getDataTime() + '] [' + this.appName + '] ' + Log.fg.yellow + msg + Log.ac.reset,
|
||||
util.inspect(op, options),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -111,7 +117,10 @@ module.exports = class Logger {
|
||||
* @returns
|
||||
*/
|
||||
error(msg, op = '') {
|
||||
console.error('[' + this.getDataTime() + '] [' + this.appName + '] ' + msg, util.inspect(op, options));
|
||||
console.info(
|
||||
'[' + this.getDataTime() + '] [' + this.appName + '] ' + Log.fg.red + msg + Log.ac.reset,
|
||||
util.inspect(op, options),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user