@livy/util
Version:
Common utilities for the Livy logger
26 lines (25 loc) • 770 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RespectLevelMixin = void 0;
const log_level_1 = require("@livy/contracts/lib/log-level");
const mixin_1 = require("../mixin");
/**
* Implements a level-respecting `isHandling` method
*/
exports.RespectLevelMixin = (0, mixin_1.Mixin)(BaseClass => {
return class RespectLevelMixin extends BaseClass {
constructor() {
super(...arguments);
/**
* The minimum activation level for this handler
*/
this.level = 'debug';
}
/**
* @inheritdoc
*/
isHandling(level) {
return log_level_1.SeverityMap[level] <= log_level_1.SeverityMap[this.level];
}
};
});