Skip to content

Commit b5eb021

Browse files
authored
[model-gateway] Improve logging in data_connector module (#15495)
1 parent d72e908 commit b5eb021

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

sgl-model-gateway/src/data_connector/factory.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// factory.rs
22
//
33
// Factory function to create storage backends based on configuration.
4-
// This centralizes storage initialization logic and fixes the bug where
5-
// conversation_item_storage was missing/incorrect in server.rs.
64

75
use std::sync::Arc;
86

sgl-model-gateway/src/data_connector/memory.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,11 @@ impl ResponseStorage for MemoryResponseStorage {
332332
.push(response_id.clone());
333333
}
334334

335-
// Store the response
336335
store.responses.insert(response_id.clone(), response);
337-
tracing::info!("memory_store_size" = store.responses.len());
336+
tracing::debug!(
337+
memory_store_size = store.responses.len(),
338+
"Response stored in memory"
339+
);
338340

339341
Ok(response_id)
340342
}
@@ -345,7 +347,7 @@ impl ResponseStorage for MemoryResponseStorage {
345347
) -> ResponseResult<Option<StoredResponse>> {
346348
let store = self.store.read();
347349
let result = store.responses.get(response_id).cloned();
348-
tracing::info!("memory_get_response" = %response_id.0, found = result.is_some());
350+
tracing::debug!(response_id = %response_id.0, found = result.is_some(), "Memory response lookup");
349351
Ok(result)
350352
}
351353

sgl-model-gateway/src/data_connector/postgres.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use chrono::{DateTime, Utc};
1313
use deadpool_postgres::{Manager, ManagerConfig, Pool, RecyclingMethod};
1414
use serde_json::Value;
1515
use tokio_postgres::{NoTls, Row};
16+
use tracing;
1617

1718
use crate::{
1819
config::PostgresConfig,
@@ -588,7 +589,7 @@ impl ResponseStorage for PostgresResponseStorage {
588589
&conversation_id,
589590
&json_raw_response,
590591
]).await.unwrap();
591-
println!("INSERT INTO responses VALUES {insert_count}");
592+
tracing::debug!(rows_affected = insert_count, "Response stored in Postgres");
592593
Ok(response_id)
593594
}
594595

0 commit comments

Comments
 (0)