From 755149d3b0f9093241f25cb38587e5cbae439655 Mon Sep 17 00:00:00 2001 From: 0xWulf Date: Tue, 8 Jul 2025 09:45:45 +0900 Subject: [PATCH] chore: silence logs in production --- client/src/main.tsx | 5 +++++ server/index.ts | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/client/src/main.tsx b/client/src/main.tsx index e92b8e7..bf2c5da 100644 --- a/client/src/main.tsx +++ b/client/src/main.tsx @@ -7,6 +7,11 @@ import { AuthProvider } from "./contexts/AuthContext"; import { QueryClientProvider } from "@tanstack/react-query"; import { queryClient } from "@/lib/queryClient"; +// Disable console.log in production to avoid verbose output +if (process.env.NODE_ENV === "production") { + console.log = () => {}; +} + const root = createRoot(document.getElementById("root")!); root.render( diff --git a/server/index.ts b/server/index.ts index 8a02633..3ef53b4 100644 --- a/server/index.ts +++ b/server/index.ts @@ -14,6 +14,11 @@ import { setupVite, serveStatic } from "./vite"; import logger from "./logger"; import "./logger.ts"; // force esbuild to preserve it +// Disable console.log in production to avoid verbose output +if (process.env.NODE_ENV === "production") { + console.log = () => {}; +} + /* ────────────────────────────────────────────────────────────────── */ /* 0. Winston test log – confirms logger is active */