refactor logger for clarity
This commit is contained in:
1 parent
a798f98ff4
commit
c9ba0be2c5
1 file changed
+6
-5
@@ -22,6 +22,7 @@ class Logger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (logLevel === "error") {
|
if (logLevel === "error") {
|
||||||
|
this.error = console.error.bind(console);
|
||||||
this.info = NO_OP;
|
this.info = NO_OP;
|
||||||
this.warn = NO_OP;
|
this.warn = NO_OP;
|
||||||
this.log = NO_OP;
|
this.log = NO_OP;
|
||||||
@@ -29,20 +30,20 @@ class Logger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (logLevel === "warn") {
|
if (logLevel === "warn") {
|
||||||
|
this.error = console.error.bind(console);
|
||||||
|
this.warn = console.warn.bind(console);
|
||||||
this.info = NO_OP;
|
this.info = NO_OP;
|
||||||
this.log = NO_OP;
|
this.log = NO_OP;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logLevel === "info") {
|
if (logLevel === "info") {
|
||||||
|
this.error = console.error.bind(console);
|
||||||
|
this.warn = console.warn.bind(console);
|
||||||
|
this.info = console.info.bind(console);
|
||||||
this.log = NO_OP;
|
this.log = NO_OP;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.error = console.error.bind(console);
|
|
||||||
this.warn = console.warn.bind(console);
|
|
||||||
this.info = console.info.bind(console);
|
|
||||||
this.log = console.log.bind(console);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
|
|||||||
Reference in new issue
Block a user