[model-gateway] Improve logging across core modules (#15497)

This commit is contained in:
Simo Lin
2025-12-19 13:35:28 -08:00
committed by GitHub
parent 6afc5d497b
commit ba72e759ca
19 changed files with 73 additions and 66 deletions
+1 -2
View File
@@ -59,8 +59,7 @@ impl L0Cache {
// Simple eviction: if we're at capacity, remove a random entry
// DashMap doesn't support LRU directly, so we use a simple strategy
if self.map.len() >= self.max_entries {
// Get the key to remove in a separate scope to ensure iterator is dropped
let key_to_remove = { self.map.iter().next().map(|entry| entry.key().clone()) }; // Iterator fully dropped here, all locks released
let key_to_remove = { self.map.iter().next().map(|entry| entry.key().clone()) };
// Now remove it
if let Some(k) = key_to_remove {
+3 -3
View File
@@ -1,7 +1,7 @@
use std::{fs::File, io::Read, path::Path, sync::Arc};
use anyhow::{Error, Result};
use tracing::{debug, info};
use tracing::debug;
use super::{huggingface::HuggingFaceTokenizer, tiktoken::TiktokenTokenizer, traits};
use crate::tokenizer::hub::download_tokenizer_from_hf;
@@ -215,10 +215,10 @@ fn resolve_and_log_chat_template(
match (&provided_path, &final_chat_template) {
(Some(provided), _) => {
info!("Using provided chat template: {}", provided);
debug!("Using provided chat template: {}", provided);
}
(None, Some(discovered)) => {
info!(
debug!(
"Auto-discovered chat template in '{}': {}",
discovery_dir.display(),
discovered