Skip to content

Commit 4fafb0c

Browse files
Downgrade SQLite cache log messages from info to debug
1 parent 3fa340a commit 4fafb0c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

safetytooling/apis/inference/sqlite_cache_manager.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def maybe_load_cache(self, prompt: Prompt, params: LLMParams) -> LLMCache | None
208208

209209
if version != SCHEMA_VERSION:
210210
self.stats.stale += 1
211-
LOGGER.info(f"Cache stale (schema v{version} != v{SCHEMA_VERSION}) for {prompt_hash}")
211+
LOGGER.debug(f"Cache stale (schema v{version} != v{SCHEMA_VERSION}) for {prompt_hash}")
212212
return None
213213

214214
# Update access metadata
@@ -314,7 +314,7 @@ def process_cached_responses(
314314
if cached_result is not None and cached_result.responses is not None:
315315
responses_list = cached_result.responses
316316
db_path, _ = self.get_cache_file(prompt=individual_prompt, params=params)
317-
LOGGER.info(f"Loaded cache for prompt from {db_path}")
317+
LOGGER.debug(f"Loaded cache for prompt from {db_path}")
318318

319319
prop_empty_completions = sum(1 for response in responses_list if response.completion == "") / len(
320320
responses_list
@@ -369,7 +369,7 @@ def update_failed_cache(
369369
for i in range(len(responses)):
370370
responses[i].api_failures = (failed_cache_responses[0][i].api_failures or 0) + 1
371371

372-
LOGGER.info(f"Updating previous failures for prompt with {len(responses)} responses")
372+
LOGGER.debug(f"Updating previous failures for prompt with {len(responses)} responses")
373373
return responses
374374

375375
def save_cache(self, prompt: Prompt, params: LLMParams, responses: list):
@@ -514,7 +514,7 @@ def __del__(self):
514514
# ──────────────────────────────────────────────
515515

516516
def print_stats(self):
517-
LOGGER.info(self.stats.summary())
517+
LOGGER.debug(self.stats.summary())
518518

519519
def db_sizes(self) -> dict[str, float]:
520520
"""Return size in MB of each SQLite database in the cache dir."""

0 commit comments

Comments
 (0)