Add none logging level, update readme

This commit is contained in:
Alex Holliday committed 2024-08-19 14:28:18 -07:00
1 parent 5c561d87ce
commit 5eb022a3c2
2 files changed
+15 -6

No files matched your search

+8
View File
@@ -3,6 +3,13 @@ class Logger {
constructor(logLevel) {
const NO_OP = () => {};
if (logLevel === "none") {
this.error = NO_OP;
this.warn = NO_OP;
this.log = NO_OP;
return;
}
this.error = console.error.bind(console);
if (logLevel === "error") {
@@ -14,6 +21,7 @@ class Logger {
if (logLevel === "warn") {
this.log = NO_OP;
return;
}
this.log = console.log.bind(console);
}