diff --git a/web/.env.example b/web/.env.example index 3fe854eb2..cda728699 100644 --- a/web/.env.example +++ b/web/.env.example @@ -2,3 +2,4 @@ VITE_ACCOUNT=https://localhost:8008 VITE_CONNECT=https://connect.myunraid.net VITE_UNRAID_NET=https://unraid.ddev.site VITE_CALLBACK_KEY=aNotSoSecretKeyUsedToObfuscateQueryParams +VITE_ALLOW_CONSOLE_LOGS=false \ No newline at end of file diff --git a/web/helpers/functions.ts b/web/helpers/functions.ts index b7d6ab733..9c34883b1 100644 --- a/web/helpers/functions.ts +++ b/web/helpers/functions.ts @@ -2,7 +2,7 @@ export const OBJ_TO_STR = (obj: object): string => Object.entries(obj).reduce((str, [p, val]) => `${str}${p}: ${val}\n`, ''); /** Removes our dev logs from prod builds */ export const disableProductionConsoleLogs = () => { - if (import.meta.env.PROD) { + if (import.meta.env.PROD && !import.meta.env.VITE_ALLOW_CONSOLE_LOGS) { console.log = () => {}; console.debug = () => {}; console.info = () => {};