@@ -16,6 +16,7 @@ use actix_web::{
1616} ;
1717use futures:: { future, Future } ;
1818use lazy_static:: lazy_static;
19+ use log:: debug;
1920use regex:: Regex ;
2021use serde:: {
2122 de:: { Deserializer , Error as SerdeError , IgnoredAny } ,
@@ -120,7 +121,7 @@ impl FromRequest for BsoBodies {
120121 let default = HeaderValue :: from_static ( "" ) ;
121122 let content_type = get_trimmed_header ( headers, CONTENT_TYPE , & default) ;
122123
123- dbg ! ( & content_type) ;
124+ debug ! ( "content_type: {:?}" , & content_type) ;
124125
125126 match content_type. as_str ( ) {
126127 "application/json" | "text/plain" | "application/newlines" | "" => ( ) ,
@@ -138,7 +139,7 @@ impl FromRequest for BsoBodies {
138139
139140 // Load the entire request into a String
140141 let fut = <String >:: from_request ( req, payload) . map_err ( |e| {
141- dbg ! ( "⚠️ Payload read error" , e) ;
142+ debug ! ( "⚠️ Payload read error: {:?} " , e) ;
142143 ValidationErrorKind :: FromDetails (
143144 "Mimetype/encoding/content-length error" . to_owned ( ) ,
144145 RequestErrorLocation :: Header ,
@@ -165,7 +166,7 @@ impl FromRequest for BsoBodies {
165166 let state = match req. app_data :: < ServerState > ( ) {
166167 Some ( s) => s,
167168 None => {
168- dbg ! ( "⚠️ Could not load the app state" ) ;
169+ debug ! ( "⚠️ Could not load the app state" ) ;
169170 return Box :: new ( future:: err (
170171 ValidationErrorKind :: FromDetails (
171172 "Internal error" . to_owned ( ) ,
@@ -315,7 +316,7 @@ impl FromRequest for BsoBody {
315316 let state = match req. app_data :: < ServerState > ( ) {
316317 Some ( s) => s,
317318 None => {
318- dbg ! ( "⚠️ Could not load the app state" ) ;
319+ debug ! ( "⚠️ Could not load the app state" ) ;
319320 return Box :: new ( future:: err (
320321 ValidationErrorKind :: FromDetails (
321322 "Internal error" . to_owned ( ) ,
@@ -391,7 +392,7 @@ impl BsoParam {
391392 }
392393 if let Some ( v) = elements. get ( 5 ) {
393394 let sv = String :: from_str ( v) . map_err ( |e| {
394- dbg ! ( "⚠️ BsoParam Error" , v, e) ;
395+ debug ! ( "⚠️ BsoParam Error element:{:?} error:{:?} " , v, e) ;
395396 ValidationErrorKind :: FromDetails (
396397 "Invalid BSO" . to_owned ( ) ,
397398 RequestErrorLocation :: Path ,
@@ -615,7 +616,7 @@ impl FromRequest for CollectionPostRequest {
615616 let state = match req. app_data :: < ServerState > ( ) {
616617 Some ( s) => s,
617618 None => {
618- dbg ! ( "⚠️ Could not load the app state" ) ;
619+ debug ! ( "⚠️ Could not load the app state" ) ;
619620 return Box :: new ( future:: err (
620621 ValidationErrorKind :: FromDetails (
621622 "Internal error" . to_owned ( ) ,
@@ -798,7 +799,7 @@ impl FromRequest for ConfigRequest {
798799 let state = match req. app_data :: < ServerState > ( ) {
799800 Some ( s) => s,
800801 None => {
801- dbg ! ( "⚠️ Could not load the app state" ) ;
802+ debug ! ( "⚠️ Could not load the app state" ) ;
802803 return Err ( ValidationErrorKind :: FromDetails (
803804 "Internal error" . to_owned ( ) ,
804805 RequestErrorLocation :: Unknown ,
@@ -859,7 +860,7 @@ impl HawkIdentifier {
859860 let elements: Vec < & str > = uri. path ( ) . split ( '/' ) . collect ( ) ;
860861 if let Some ( v) = elements. get ( 2 ) {
861862 u64:: from_str ( v) . map_err ( |e| {
862- dbg ! ( "⚠️ HawkIdentifier Error" , v, e) ;
863+ debug ! ( "⚠️ HawkIdentifier Error {:?} {:?} " , v, e) ;
863864 ValidationErrorKind :: FromDetails (
864865 "Invalid UID" . to_owned ( ) ,
865866 RequestErrorLocation :: Path ,
@@ -936,7 +937,7 @@ impl FromRequest for HawkIdentifier {
936937 let state = match req. app_data :: < ServerState > ( ) {
937938 Some ( s) => s,
938939 None => {
939- dbg ! ( "⚠️ Could not load the app state" ) ;
940+ debug ! ( "⚠️ Could not load the app state" ) ;
940941 return Err ( ValidationErrorKind :: FromDetails (
941942 "Internal error" . to_owned ( ) ,
942943 RequestErrorLocation :: Unknown ,
@@ -964,7 +965,7 @@ impl From<u32> for HawkIdentifier {
964965
965966pub fn extrude_db ( exts : & Extensions ) -> Result < Box < dyn Db > , Error > {
966967 exts. get :: < Box < dyn Db > > ( ) . cloned ( ) . ok_or_else ( || {
967- dbg ! ( "⚠️ DB Error: No db" ) ;
968+ debug ! ( "⚠️ DB Error: No db" ) ;
968969 ErrorInternalServerError ( "Unexpected Db error: No DB" . to_owned ( ) )
969970 } )
970971}
@@ -1074,7 +1075,7 @@ impl FromRequest for BatchRequestOpt {
10741075 let state = match req. app_data :: < ServerState > ( ) {
10751076 Some ( s) => s,
10761077 None => {
1077- dbg ! ( "⚠️ Could not load the app state" ) ;
1078+ debug ! ( "⚠️ Could not load the app state" ) ;
10781079 return Err ( ValidationErrorKind :: FromDetails (
10791080 "Internal error" . to_owned ( ) ,
10801081 RequestErrorLocation :: Unknown ,
0 commit comments