diff --git a/app/layout.tsx b/app/layout.tsx index e0eefbf4..452322fa 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,10 +1,10 @@ import React from "react"; import type {Metadata} from "next"; import {Inter} from "next/font/google"; - import "./globals.css"; import {Providers} from "./providers"; import {cn} from "@/lib/utils"; +import {ConsoleSilencer} from "@/components/wrappers/common/console-silencer"; const inter = Inter({subsets: ["latin"]}); @@ -24,6 +24,7 @@ export default function RootLayout({ + {children} diff --git a/src/components/wrappers/common/console-silencer.tsx b/src/components/wrappers/common/console-silencer.tsx new file mode 100644 index 00000000..5536c6a3 --- /dev/null +++ b/src/components/wrappers/common/console-silencer.tsx @@ -0,0 +1,15 @@ +"use client"; + +import { useEffect } from "react"; + +export function ConsoleSilencer() { + useEffect(() => { + if (process.env.NODE_ENV === "production") { + for (const method of ["log", "debug", "info", "warn", "error"] as const) { + console[method] = () => {}; + } + } + }, []); + + return null; +} \ No newline at end of file