chore: Add log-level parameter to cache analysis experiments

this is to allow turning on debug log for debugging if some unexpected behavior observed during running cache analysis experiments.

PiperOrigin-RevId: 811189954
This commit is contained in:
Xiang (Sean) Zhou
2025-09-24 22:44:41 -07:00
committed by Copybara-Service
parent c8c6cd70a4
commit c6b6b6f3c6
@@ -25,6 +25,7 @@ import argparse
import asyncio
import copy
import json
import logging
import sys
import time
from typing import Any
@@ -42,6 +43,7 @@ except ImportError:
from utils import get_test_prompts
from utils import run_experiment_batch
from google.adk.cli.utils import logs
from google.adk.runners import InMemoryRunner
from google.adk.utils.cache_performance_analyzer import CachePerformanceAnalyzer
@@ -570,9 +572,19 @@ async def main():
" 2.0)"
),
)
parser.add_argument(
"--log-level",
choices=["DEBUG", "INFO", "WARNING", "ERROR"],
default="INFO",
help="Set logging level (default: INFO)",
)
args = parser.parse_args()
# Setup logger with specified level
log_level = getattr(logging, args.log_level.upper())
logs.setup_adk_logger(log_level)
# Set default output filename based on model
if not args.output:
args.output = (