@atomiqlabs/base
Version:
Base classes and interfaces for atomiq protocol
18 lines (17 loc) • 744 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getLogger = void 0;
/**
* Getter function to create a logger instance
*
* @internal
*/
function getLogger(prefix) {
return {
debug: (msg, ...args) => global.atomiqLogLevel >= 3 && console.debug(prefix + msg, ...args),
info: (msg, ...args) => global.atomiqLogLevel >= 2 && console.info(prefix + msg, ...args),
warn: (msg, ...args) => (global.atomiqLogLevel == null || global.atomiqLogLevel >= 1) && console.warn(prefix + msg, ...args),
error: (msg, ...args) => (global.atomiqLogLevel == null || global.atomiqLogLevel >= 0) && console.error(prefix + msg, ...args)
};
}
exports.getLogger = getLogger;