[mirotalk] - fix typo
This commit is contained in:
+10
-7
@@ -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/, '');
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user