From 3b2e30411cfa37fdea74b48f7ff860932da52013 Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 2 Sep 2025 18:37:51 +0300 Subject: [PATCH] Change Redis debugging logs to WARN level --- src/app_state.rs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/app_state.rs b/src/app_state.rs index ba5653b..4557ecb 100644 --- a/src/app_state.rs +++ b/src/app_state.rs @@ -28,13 +28,13 @@ impl AppState { /// Инициализация с кастомной конфигурацией безопасности. pub async fn new_with_config(security_config: SecurityConfig) -> Self { - log::info!("🚀 Starting AppState initialization..."); + log::warn!("🚀 Starting AppState initialization..."); // Получаем конфигурацию для Redis с таймаутом - log::info!("📋 Getting REDIS_URL from environment..."); + log::warn!("📋 Getting REDIS_URL from environment..."); let redis_url = match env::var("REDIS_URL") { Ok(url) => { - log::info!("✅ REDIS_URL found in environment"); + log::warn!("✅ REDIS_URL found in environment"); url } Err(e) => { @@ -44,17 +44,17 @@ impl AppState { }; // Детальное логирование для отладки - log::info!("🔗 Redis URL: {}", redis_url.replace(&redis_url.split('@').nth(0).unwrap_or(""), "***")); + log::warn!("🔗 Redis URL: {}", redis_url.replace(&redis_url.split('@').nth(0).unwrap_or(""), "***")); // Парсим URL для детального анализа - log::info!("🔍 Parsing Redis URL..."); + log::warn!("🔍 Parsing Redis URL..."); match url::Url::parse(&redis_url) { Ok(parsed_url) => { - log::info!("✅ Redis URL parsed successfully"); - log::info!(" Host: {}", parsed_url.host_str().unwrap_or("none")); - log::info!(" Port: {}", parsed_url.port().unwrap_or(0)); - log::info!(" Username: '{}'", parsed_url.username()); - log::info!(" Password: {}", if parsed_url.password().is_some() { "***" } else { "none" }); + log::warn!("✅ Redis URL parsed successfully"); + log::warn!(" Host: {}", parsed_url.host_str().unwrap_or("none")); + log::warn!(" Port: {}", parsed_url.port().unwrap_or(0)); + log::warn!(" Username: '{}'", parsed_url.username()); + log::warn!(" Password: {}", if parsed_url.password().is_some() { "***" } else { "none" }); } Err(e) => { log::error!("❌ Failed to parse Redis URL: {}", e); @@ -64,7 +64,7 @@ impl AppState { let redis_client = match RedisClient::open(redis_url) { Ok(client) => { - log::info!("✅ Redis client created successfully"); + log::warn!("✅ Redis client created successfully"); client } Err(e) => { @@ -74,7 +74,7 @@ impl AppState { }; // Устанавливаем таймаут для Redis операций с graceful fallback - log::info!("🔄 Attempting Redis connection with timeout: {}s", security_config.request_timeout_seconds); + log::warn!("🔄 Attempting Redis connection with timeout: {}s", security_config.request_timeout_seconds); let redis_connection = match tokio::time::timeout( Duration::from_secs(security_config.request_timeout_seconds), @@ -83,7 +83,7 @@ impl AppState { .await { Ok(Ok(mut conn)) => { - log::info!("✅ Redis connection established"); + log::warn!("✅ Redis connection established"); // Тестируем подключение простой командой match tokio::time::timeout( @@ -91,7 +91,7 @@ impl AppState { conn.ping::() ).await { Ok(Ok(result)) => { - log::info!("✅ Redis PING successful: {}", result); + log::warn!("✅ Redis PING successful: {}", result); Some(conn) } Ok(Err(e)) => {