[mirotalksfu] - improve Logger

هذا الالتزام موجود في:
Miroslav Pejic
2021-10-11 18:01:49 +02:00
الأصل 5ca30fabf4
التزام bc5e467659

عرض الملف

@@ -9,17 +9,18 @@ module.exports = class Logger {
debug(msg, op = '') {
if (this.debugOn === false) return;
let dataTime = new Date().toISOString().replace(/T/, ' ').replace(/Z/, '');
console.log('[' + dataTime + '] [' + this.appName + '] ' + msg, op);
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/, '');
}
};