summaryrefslogtreecommitdiff
path: root/logging/handler.ts
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2018-12-19 19:16:45 +0100
committerRyan Dahl <ry@tinyclouds.org>2018-12-19 13:16:45 -0500
commit6624584dd476f0f261376e7c625a318049d2bd83 (patch)
treeea59dade4e002f69e28df6ec696a86a37fc95821 /logging/handler.ts
parent700b4ce0d99dca02fe192c8722ab1bb7a33dc709 (diff)
Add logging module (denoland/deno_std#33)
Original: https://github.com/denoland/deno_std/commit/25b88bcf8c260865d2b6b68f539c4772bac095ee
Diffstat (limited to 'logging/handler.ts')
-rw-r--r--logging/handler.ts18
1 files changed, 18 insertions, 0 deletions
diff --git a/logging/handler.ts b/logging/handler.ts
new file mode 100644
index 000000000..2d76f5a78
--- /dev/null
+++ b/logging/handler.ts
@@ -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) {}
+}