Skip to content

Commit bf2cd6f

Browse files
author
jack
committed
Reduce verbose pricing logs to debug level
- Move frequent operational logs from INFO to DEBUG level - Keep only essential API fetch notifications at INFO level - Significantly reduces log noise in production
1 parent fe30ccd commit bf2cd6f

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

crates/goose-server/src/routes/config_management.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ pub async fn get_pricing(
420420
}
421421
}
422422

423-
tracing::info!(
423+
tracing::debug!(
424424
"Returning pricing for {} models{}",
425425
pricing_data.len(),
426426
if configured_only {

crates/goose/src/providers/pricing.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ impl PricingCache {
7070
let age_days = (now - cached.fetched_at) / (24 * 60 * 60);
7171

7272
if age_days < CACHE_TTL_DAYS {
73-
tracing::info!(
73+
tracing::debug!(
7474
"Loaded pricing data from disk cache (age: {} days)",
7575
age_days
7676
);
7777
Ok(Some(cached))
7878
} else {
79-
tracing::info!("Disk cache expired (age: {} days)", age_days);
79+
tracing::debug!("Disk cache expired (age: {} days)", age_days);
8080
Ok(None)
8181
}
8282
}
@@ -102,7 +102,7 @@ impl PricingCache {
102102
let json_data = serde_json::to_vec_pretty(data)?;
103103
tokio::fs::write(&cache_path, json_data).await?;
104104

105-
tracing::info!("Saved pricing data to disk cache");
105+
tracing::debug!("Saved pricing data to disk cache");
106106
Ok(())
107107
}
108108

@@ -177,7 +177,7 @@ impl PricingCache {
177177
.values()
178178
.map(|models| models.len())
179179
.sum();
180-
tracing::info!(
180+
tracing::debug!(
181181
"Fetched pricing for {} providers with {} total models from OpenRouter",
182182
cached_data.pricing.len(),
183183
total_models
@@ -201,7 +201,7 @@ impl PricingCache {
201201
if let Ok(Some(cached)) = self.load_from_disk().await {
202202
// Log how many models we have cached
203203
let total_models: usize = cached.pricing.values().map(|models| models.len()).sum();
204-
tracing::info!(
204+
tracing::debug!(
205205
"Loaded {} providers with {} total models from disk cache",
206206
cached.pricing.len(),
207207
total_models
@@ -217,7 +217,7 @@ impl PricingCache {
217217
}
218218

219219
// If no disk cache, fetch from OpenRouter
220-
tracing::info!("No valid disk cache found, fetching from OpenRouter");
220+
tracing::info!("Fetching pricing data from OpenRouter API");
221221
self.refresh().await
222222
}
223223
}

0 commit comments

Comments
 (0)