@@ -98,13 +98,13 @@ fn parse_grpc_response<T: serde::Serialize>(
9898 match result {
9999 Ok ( r) => {
100100 let inner = r. into_inner ( ) ;
101- log:: info !( "Request succeeded" ) ;
101+ log:: debug !( "Request succeeded" ) ;
102102 log:: debug!( "Response: {}" , serde_json:: json!( inner) ) ;
103103 ( reply:: json ( & inner) , StatusCode :: OK )
104104 }
105105 Err ( s) => {
106106 let ( status_code, error_code) = match_status ( & s) ;
107- log:: info !( "Request failed, error_code={}" , error_code) ;
107+ log:: debug !( "Request failed, error_code={}" , error_code) ;
108108 log:: debug!( "Response: {}" , serde_json:: json!( s. message( ) ) ) ;
109109 (
110110 reply:: json ( & ApiError :: new ( s. message ( ) . into ( ) , error_code) ) ,
@@ -119,10 +119,10 @@ async fn register(
119119 addr : Option < std:: net:: SocketAddr > ,
120120 mut grpc_conn : PublicTowerServicesClient < Channel > ,
121121) -> std:: result:: Result < impl Reply , Rejection > {
122- match addr {
123- Some ( a ) => log :: info! ( "Received register request from {}" , a ) ,
124- None => log :: info! ( "Received register request from unknown address") ,
125- }
122+ log :: debug! (
123+ "Received a register request from {}" ,
124+ addr . map_or ( "an unknown address". to_owned ( ) , |a| a . to_string ( ) )
125+ ) ;
126126
127127 let user_id = req. user_id . clone ( ) ;
128128 if user_id. is_empty ( ) {
@@ -145,10 +145,10 @@ async fn add_appointment(
145145 addr : Option < std:: net:: SocketAddr > ,
146146 mut grpc_conn : PublicTowerServicesClient < Channel > ,
147147) -> std:: result:: Result < impl Reply , Rejection > {
148- match addr {
149- Some ( a ) => log :: info! ( "Received add_appointment request from {}" , a ) ,
150- None => log :: info! ( "Received add_appointment request from unknown address") ,
151- }
148+ log :: debug! (
149+ "Received an add_appointment request from {}" ,
150+ addr . map_or ( "an unknown address". to_owned ( ) , |a| a . to_string ( ) )
151+ ) ;
152152
153153 if let Some ( a) = & req. appointment {
154154 if a. locator . is_empty ( ) {
@@ -177,10 +177,10 @@ async fn get_appointment(
177177 addr : Option < std:: net:: SocketAddr > ,
178178 mut grpc_conn : PublicTowerServicesClient < Channel > ,
179179) -> std:: result:: Result < impl Reply , Rejection > {
180- match addr {
181- Some ( a ) => log :: info! ( "Received get_appointment request from {}" , a ) ,
182- None => log :: info! ( "Received get_appointment request from unknown address") ,
183- }
180+ log :: debug! (
181+ "Received an get_appointment request from {}" ,
182+ addr . map_or ( "an unknown address". to_owned ( ) , |a| a . to_string ( ) )
183+ ) ;
184184
185185 if req. locator . is_empty ( ) {
186186 return Err ( ApiError :: empty_field ( "locator" ) ) ;
@@ -205,10 +205,10 @@ async fn get_subscription_info(
205205 addr : Option < std:: net:: SocketAddr > ,
206206 mut grpc_conn : PublicTowerServicesClient < Channel > ,
207207) -> std:: result:: Result < impl Reply , Rejection > {
208- match addr {
209- Some ( a ) => log :: info! ( "Received get_subscription_info request from {}" , a ) ,
210- None => log :: info! ( "Received get_subscription_info request from unknown address") ,
211- }
208+ log :: debug! (
209+ "Received an get_subscription_info request from {}" ,
210+ addr . map_or ( "an unknown address". to_owned ( ) , |a| a . to_string ( ) )
211+ ) ;
212212
213213 if req. signature . is_empty ( ) {
214214 return Err ( ApiError :: empty_field ( "signature" ) ) ;
0 commit comments