ts-logs
Version:
This package provide a skd for audit and manager logs in nodejs and express
25 lines • 746 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GlobalLog = void 0;
const log_1 = require("./log");
/**
* @description Global log instance
*/
class GlobalLog {
/**
* @description Get or Create a log singleton instance
* @param props as options to define id and name for log object.
* @returns instance of Log.
*/
static singleton(props) {
if (!GlobalLog.instance) {
const name = props?.name ?? 'global-log';
const uid = props?.uid;
GlobalLog.instance = log_1.Log.init({ name, uid });
}
return GlobalLog.instance;
}
}
exports.GlobalLog = GlobalLog;
exports.default = GlobalLog;
//# sourceMappingURL=global-log.js.map