Skip to content

Commit 204ce97

Browse files
authored
Merge pull request #16 from hexawulf/codex/remove-verbose-logging-in-production
Silence logs in production
2 parents c122365 + 755149d commit 204ce97

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

client/src/main.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ import { AuthProvider } from "./contexts/AuthContext";
77
import { QueryClientProvider } from "@tanstack/react-query";
88
import { queryClient } from "@/lib/queryClient";
99

10+
// Disable console.log in production to avoid verbose output
11+
if (process.env.NODE_ENV === "production") {
12+
console.log = () => {};
13+
}
14+
1015
const root = createRoot(document.getElementById("root")!);
1116
root.render(
1217
<QueryClientProvider client={queryClient}>

server/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ import { setupVite, serveStatic } from "./vite";
1414
import logger from "./logger";
1515
import "./logger.ts"; // force esbuild to preserve it
1616

17+
// Disable console.log in production to avoid verbose output
18+
if (process.env.NODE_ENV === "production") {
19+
console.log = () => {};
20+
}
21+
1722

1823
/* ────────────────────────────────────────────────────────────────── */
1924
/* 0. Winston test log – confirms logger is active */

0 commit comments

Comments
 (0)