From 63809c0597c6d6736c4ae7cd927522b9aed351ee Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 7 Oct 2026 04:04:46 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20[code=20health=20improvement]=20?= =?UTF-8?q?Suppress=20console=20logs=20in=20production?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Horizontal42 <75383519+Horizontal42@users.noreply.github.com> --- src/logger.ts | 12 +++++++++--- src/vite-env.d.ts | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 src/vite-env.d.ts diff --git a/src/logger.ts b/src/logger.ts index ae043bf..bfa8892 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -1,5 +1,11 @@ export const logger = { - info: (...args: any[]) => console.info(...args), - warn: (...args: any[]) => console.warn(...args), - error: (...args: any[]) => console.error(...args), + info: (...args: any[]) => { + if (!import.meta.env.PROD) console.info(...args); + }, + warn: (...args: any[]) => { + if (!import.meta.env.PROD) console.warn(...args); + }, + error: (...args: any[]) => { + if (!import.meta.env.PROD) console.error(...args); + }, }; diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts new file mode 100644 index 0000000..11f02fe --- /dev/null +++ b/src/vite-env.d.ts @@ -0,0 +1 @@ +///