diff --git a/src/handlers.rs b/src/handlers.rs index 10d17d5..eb8c72a 100644 --- a/src/handlers.rs +++ b/src/handlers.rs @@ -19,7 +19,7 @@ use futures_util::StreamExt; use reqwest::{header, Method}; use serde_json::json; use tracing::warn; -use tracing::{debug, info, error}; +use tracing::{debug, info}; use uuid::Uuid; pub async fn send_token_registration_request( @@ -230,7 +230,7 @@ pub async fn check_project_status_request( }) => { let status = StatusCode::from_u16(status_code as u16) .unwrap_or(StatusCode::INTERNAL_SERVER_ERROR); - warn!("Received status response for project. Project ID: {}, BK: {}, Status: {}, Response: {}", + debug!("Received status response for project. Project ID: {}, BK: {}, Status: {}, Response: {}", query_params.project_id, query_params.bk, status, @@ -356,7 +356,7 @@ async fn save_tokens_from_beam( Ok(v) => v, Err(e) => { let error_msg = format!("Failed to deserialize message {msg:?} into a result: {e}"); - warn!("{error_msg}"); + debug!("{error_msg}"); last_error = Some(error_msg); continue; } @@ -434,7 +434,7 @@ async fn update_tokens_from_beam( Ok(v) => v, Err(e) => { let error_msg = format!("Failed to deserialize message {msg:?} into a result: {e}"); - warn!("{error_msg}"); + debug!("{error_msg}"); last_error = Some(error_msg); continue; } @@ -506,7 +506,7 @@ async fn status_from_beam( Ok(v) => v, Err(e) => { let error_msg = format!("Failed to deserialize message {msg:?} into a result: {e}"); - warn!("{error_msg}"); + debug!("{error_msg}"); last_error = Some(error_msg); continue; } @@ -570,7 +570,7 @@ async fn fetch_project_tables_from_beam( Ok(v) => v, Err(e) => { let error_msg = format!("Failed to deserialize message {msg:?} into a result: {e}"); - warn!("{error_msg}"); + debug!("{error_msg}"); continue; } }; @@ -629,7 +629,7 @@ async fn remove_project_and_tokens_from_beam( Ok(v) => v, Err(e) => { let error_msg = format!("Failed to deserialize message {msg:?} into a result: {e}"); - warn!("{error_msg}"); + debug!("{error_msg}"); last_error = Some(error_msg); continue; } @@ -690,7 +690,7 @@ async fn remove_tokens_from_beam( Ok(v) => v, Err(e) => { let error_msg = format!("Failed to deserialize message {msg:?} into a result: {e}"); - warn!("{error_msg}"); + debug!("{error_msg}"); last_error = Some(error_msg); continue; } diff --git a/src/routes.rs b/src/routes.rs index 44acf0f..24f908c 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -13,11 +13,11 @@ use axum::{ Json, Router, }; use serde_json::json; -use tracing::{error, warn}; +use tracing::debug; async fn create_token(db: Db, token_params: Json) -> impl IntoResponse { if let Err(e) = send_token_registration_request(db, token_params.0).await { - error!("Unhandled error: {e:?}"); + debug!("Unhandled error: {e:?}"); StatusCode::INTERNAL_SERVER_ERROR } else { StatusCode::OK @@ -52,7 +52,7 @@ async fn generate_script(mut db: Db, script_params: Json) -> impl I match db.generate_user_script(script_params.0).await { Ok(script) => (StatusCode::OK, script).into_response(), Err(e) => { - warn!("Error generating script: {e}"); + debug!("Error generating script: {e}"); StatusCode::INTERNAL_SERVER_ERROR.into_response() } } @@ -60,7 +60,7 @@ async fn generate_script(mut db: Db, script_params: Json) -> impl I async fn refresh_token(db: Db, token_params: Json) -> StatusCode { if let Err(e) = refresh_token_request(db, token_params.0).await { - error!("Unhandled error: {e:?}"); + debug!("Unhandled error: {e:?}"); StatusCode::INTERNAL_SERVER_ERROR } else { StatusCode::OK @@ -74,7 +74,7 @@ async fn remove_project_and_token(db: Db, query: Query) -> i status_code, error_message, }) => { - warn!( + debug!( ?query, ?error_message, ?status_code, @@ -85,7 +85,7 @@ async fn remove_project_and_token(db: Db, query: Query) -> i (status, Json(json!({ "error": error_message }))).into_response() } Err(e) => { - error!("Unhandled error: {e:?}"); + debug!("Unhandled error: {e:?}"); StatusCode::INTERNAL_SERVER_ERROR.into_response() } } @@ -98,7 +98,7 @@ async fn remove_tokens(db: Db, query: Query) -> impl IntoResp status_code, error_message, }) => { - warn!( + debug!( ?query, ?error_message, ?status_code, @@ -109,7 +109,7 @@ async fn remove_tokens(db: Db, query: Query) -> impl IntoResp (status, Json(json!({ "error": error_message }))).into_response() } Err(e) => { - error!("Unhandled error: {e:?}"); + debug!("Unhandled error: {e:?}"); StatusCode::INTERNAL_SERVER_ERROR.into_response() } }