From 16d96960122dbe760c1f72de63efefcdad2c7b98 Mon Sep 17 00:00:00 2001 From: "Wei Sun (Jack)" Date: Tue, 27 May 2025 13:27:19 -0700 Subject: [PATCH] fix: avoid duplicating log in stderr. This was introduced to work around google-auth kills all logs via `google` root logging namespace. Given we're now using `google_adk` as root logging namesapce, we don't need additional Stream log handler now. PiperOrigin-RevId: 763924531 --- src/google/adk/cli/utils/logs.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/google/adk/cli/utils/logs.py b/src/google/adk/cli/utils/logs.py index 0ff1e2b..a9abae1 100644 --- a/src/google/adk/cli/utils/logs.py +++ b/src/google/adk/cli/utils/logs.py @@ -12,9 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +from __future__ import annotations + import logging import os -import sys import tempfile import time @@ -27,14 +28,8 @@ def setup_adk_logger(level=logging.INFO): # Configure the root logger format and level. logging.basicConfig(level=level, format=LOGGING_FORMAT) - # Set up adk_logger and log to stderr. - handler = logging.StreamHandler(sys.stderr) - handler.setLevel(level) - handler.setFormatter(logging.Formatter(LOGGING_FORMAT)) - adk_logger = logging.getLogger('google_adk') adk_logger.setLevel(level) - adk_logger.addHandler(handler) def log_to_tmp_folder(