From 5eb022a3c2741aa06a203507a37869d772b1c6f6 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Mon, 19 Aug 2024 14:28:18 -0700 Subject: [PATCH] Add none logging level, update readme --- Client/src/Utils/Logger.js | 8 ++++++++ README.md | 13 +++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Client/src/Utils/Logger.js b/Client/src/Utils/Logger.js index 722800910..02fffd6be 100644 --- a/Client/src/Utils/Logger.js +++ b/Client/src/Utils/Logger.js @@ -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); } diff --git a/README.md b/README.md index 0a26a67b4..adb9bc68f 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ BlueWave Uptime is an open source server monitoring application used to track th - [x] Ping monitoring - [x] Incidents at a glance - [x] Page speed monitoring -- [x] E-mail notifications +- [x] E-mail notifications - [ ] Scheduled maintenance (in the works) **Roadmap (short term):** @@ -62,8 +62,7 @@ Made with [contrib.rocks](https://contrib.rocks). [![Star History Chart](https://api.star-history.com/svg?repos=bluewave-labs/bluewave-uptime&type=Date)](https://star-history.com/#bluewave-labs/bluewave-uptime&Date) - -Also check other developer and contributor-friendly projects of BlueWave: +Also check other developer and contributor-friendly projects of BlueWave: - [BlueWave HRM](https://github.com/bluewave-labs/bluewave-hrm) - [BlueWave Onboarding](https://github.com/bluewave-labs/bluewave-onboarding) @@ -191,6 +190,7 @@ SYSTEM_EMAIL_PASSWORD= ``` VITE_APP_API_BASE_URL="http://localhost:5000/api/v1" +VITE_APP_API_LOG_LEVEL="debug" ``` 4. In the `Docker` directory run `docker compose up` to run the `docker-compose.yaml` file and start all four images. @@ -211,9 +211,10 @@ That's it, the application is ready to use on port 80. ##### Environmental Variables -| ENV Variable Name | Required/Optional | Type | Description | Accepted Values | -| --------------------- | ----------------- | -------- | ------------------ | --------------- | -| VITE_APP_API_BASE_URL | Required | `string` | Base URL of server | {host}/api/v1 | +| ENV Variable Name | Required/Optional | Type | Description | Accepted Values | +| --------------------- | ----------------- | -------- | ------------------ | ---------------------------------- | +| VITE_APP_API_BASE_URL | Required | `string` | Base URL of server | {host}/api/v1 | +| VITE_APP_LOG_LEVEL | Optional | `string` | Log level | `"none"`\|`"error"` \| `"warn"` \| |