[mirotalk] - improve Logger

This commit is contained in:
Miroslav Pejic
2022-08-10 11:09:51 +02:00
parent 5d70726ef7
commit 1d1367cc09
+12 -3
View File
@@ -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),
);
}
/**