[mirotalk] - fix typo

This commit is contained in:
Miroslav Pejic
2021-10-11 18:06:02 +02:00
parent 70b88e4138
commit 65effc2d6d
+10 -7
View File
@@ -1,23 +1,26 @@
'use strict';
module.exports = class Logger {
constructor(appName) {
constructor(appName, debugOn = true) {
if (appName) this.appName = appName;
else this.appName = 'mirotalk';
this.debugOn = debugOn;
}
debug(msg, op = '') {
let dataTime = new Date().toISOString().replace(/T/, ' ').replace(/Z/, '');
console.log('[' + dataTime + '] [' + this.appName + '] ' + msg, op);
if (this.debugOn === false) return;
console.log('[' + this.getDataTime() + '] [' + this.appName + '] ' + msg, op);
}
warn(msg, op = '') {
let dataTime = new Date().toISOString().replace(/T/, ' ').replace(/Z/, '');
console.warn('[' + dataTime + '] [' + this.appName + '] ' + msg, op);
console.warn('[' + this.getDataTime() + '] [' + this.appName + '] ' + msg, op);
}
error(msg, op = '') {
let dataTime = new Date().toISOString().replace(/T/, ' ').replace(/Z/, '');
console.error('[' + dataTime + '] [' + this.appName + '] ' + msg, op);
console.error('[' + this.getDataTime() + '] [' + this.appName + '] ' + msg, op);
}
getDataTime() {
return new Date().toISOString().replace(/T/, ' ').replace(/Z/, '');
}
};