From 4442e893c367a901a4c801816e0ade5b78c291c9 Mon Sep 17 00:00:00 2001
From: "N. Taylor Mullen" <ntaylormullen@google.com>
Date: Sat, 12 Jul 2025 15:42:47 -0700
Subject: fix(auth): Remove sharp edges from headless auth (#3985)

---
 packages/cli/src/ui/components/ConsolePatcher.tsx | 60 -----------------------
 1 file changed, 60 deletions(-)
 delete mode 100644 packages/cli/src/ui/components/ConsolePatcher.tsx

(limited to 'packages/cli/src/ui/components/ConsolePatcher.tsx')

diff --git a/packages/cli/src/ui/components/ConsolePatcher.tsx b/packages/cli/src/ui/components/ConsolePatcher.tsx
deleted file mode 100644
index 843c6320..00000000
--- a/packages/cli/src/ui/components/ConsolePatcher.tsx
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * @license
- * Copyright 2025 Google LLC
- * SPDX-License-Identifier: Apache-2.0
- */
-
-import { useEffect } from 'react';
-import util from 'util';
-import { ConsoleMessageItem } from '../types.js';
-
-interface UseConsolePatcherParams {
-  onNewMessage: (message: Omit<ConsoleMessageItem, 'id'>) => void;
-  debugMode: boolean;
-}
-
-export const useConsolePatcher = ({
-  onNewMessage,
-  debugMode,
-}: UseConsolePatcherParams): void => {
-  useEffect(() => {
-    const originalConsoleLog = console.log;
-    const originalConsoleWarn = console.warn;
-    const originalConsoleError = console.error;
-    const originalConsoleDebug = console.debug;
-
-    const formatArgs = (args: unknown[]): string => util.format(...args);
-
-    const patchConsoleMethod =
-      (
-        type: 'log' | 'warn' | 'error' | 'debug',
-        originalMethod: (...args: unknown[]) => void,
-      ) =>
-      (...args: unknown[]) => {
-        if (debugMode) {
-          originalMethod.apply(console, args);
-        }
-
-        // Then, if it's not a debug message or debugMode is on, pass to onNewMessage
-        if (type !== 'debug' || debugMode) {
-          onNewMessage({
-            type,
-            content: formatArgs(args),
-            count: 1,
-          });
-        }
-      };
-
-    console.log = patchConsoleMethod('log', originalConsoleLog);
-    console.warn = patchConsoleMethod('warn', originalConsoleWarn);
-    console.error = patchConsoleMethod('error', originalConsoleError);
-    console.debug = patchConsoleMethod('debug', originalConsoleDebug);
-
-    return () => {
-      console.log = originalConsoleLog;
-      console.warn = originalConsoleWarn;
-      console.error = originalConsoleError;
-      console.debug = originalConsoleDebug;
-    };
-  }, [onNewMessage, debugMode]);
-};
-- 
cgit v1.2.3

