Page MenuHomePhorge

Logger.js
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

Logger.js

const debug = require('debug');
const APP_NAME = 'kolabmeet-server';
class Logger {
constructor(prefix) {
if (prefix) {
this._debug = debug(`${APP_NAME}:${prefix}`);
this._info = debug(`${APP_NAME}:INFO:${prefix}`);
this._warn = debug(`${APP_NAME}:WARN:${prefix}`);
this._error = debug(`${APP_NAME}:ERROR:${prefix}`);
} else {
this._debug = debug(APP_NAME);
this._info = debug(`${APP_NAME}:INFO`);
this._warn = debug(`${APP_NAME}:WARN`);
this._error = debug(`${APP_NAME}:ERROR`);
}
/* eslint-disable no-console */
this._debug.log = console.info.bind(console);
this._info.log = console.info.bind(console);
this._warn.log = console.warn.bind(console);
this._error.log = console.error.bind(console);
/* eslint-enable no-console */
}
get debug() {
return this._debug;
}
get info() {
return this._info;
}
get warn() {
return this._warn;
}
get error() {
return this._error;
}
}
module.exports = Logger;

File Metadata

Mime Type
text/plain
Expires
Sat, Apr 4, 3:39 AM (1 d, 22 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
a5/3b/9df6c46b3d935d6677ac90754c6e
Default Alt Text
Logger.js (1 KB)

Event Timeline