diff --git a/src/google/adk/a2a/utils/agent_to_a2a.py b/src/google/adk/a2a/utils/agent_to_a2a.py index 3e49bf7fda..4bfed2ad51 100644 --- a/src/google/adk/a2a/utils/agent_to_a2a.py +++ b/src/google/adk/a2a/utils/agent_to_a2a.py @@ -178,9 +178,7 @@ async def lifespan(app): app = to_a2a(agent, task_store=task_store, lifespan=lifespan) """ - # Set up ADK logging to ensure logs are visible when using uvicorn directly adk_logger = logging.getLogger("google_adk") - adk_logger.setLevel(logging.INFO) def create_runner() -> Runner: """Create a runner for the agent or workflow.""" diff --git a/tests/unittests/a2a/utils/test_agent_to_a2a.py b/tests/unittests/a2a/utils/test_agent_to_a2a.py index 3456834871..c9dda6af6c 100644 --- a/tests/unittests/a2a/utils/test_agent_to_a2a.py +++ b/tests/unittests/a2a/utils/test_agent_to_a2a.py @@ -656,6 +656,13 @@ def test_to_a2a_returns_starlette_app( assert result == mock_app + def test_to_a2a_keeps_configured_adk_log_level(self, caplog): + """to_a2a leaves the application's "google_adk" logger level unchanged.""" + with caplog.at_level(logging.WARNING, logger="google_adk"): + to_a2a(self.mock_agent) + + assert logging.getLogger("google_adk").level == logging.WARNING + # --------------------------------------------------------------------------- # Behavioral hosting checks (real Starlette; drive lifespan; assert routes). # ---------------------------------------------------------------------------