Original: 25b88bcf8c
This commit is contained in:
Bartek Iwańczuk 2018-12-19 19:16:45 +01:00 committed by Ryan Dahl
parent 700b4ce0d9
commit 6624584dd4
9 changed files with 293 additions and 5 deletions

18
logging/handler.ts Normal file
View file

@ -0,0 +1,18 @@
import { getLevelByName } from "./levels";
export class BaseHandler {
level: number;
levelName: string;
constructor(levelName) {
this.level = getLevelByName(levelName);
this.levelName = levelName;
}
handle(level, ...args) {
if (this.level > level) return;
return this._log(level, ...args);
}
_log(level, ...args) {}
}