diff --git a/Cargo.toml b/Cargo.toml index 23aa0ab..e01f7e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ name = "actix_admin" path = "src/lib.rs" [features] -default = ["bulma_css"] +default = ["bulma_css", 'enable-tracing'] bulma_css = [] enable-tracing = ['tracing'] diff --git a/src/lib.rs b/src/lib.rs index 46e557b..5010915 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -118,7 +118,7 @@ pub enum ActixAdminError { impl error::ResponseError for ActixAdminError { fn error_response(&self) -> HttpResponse { #[cfg(feature="enable-tracing")] - tracing::debug!("{self}"); + tracing::debug!("{self:#?}"); HttpResponse::build(self.status_code()) .insert_header(ContentType::html()) .body(self.to_string()) diff --git a/src/routes/create_or_edit_post.rs b/src/routes/create_or_edit_post.rs index d8e9f76..fab0e9a 100644 --- a/src/routes/create_or_edit_post.rs +++ b/src/routes/create_or_edit_post.rs @@ -86,6 +86,11 @@ pub async fn create_or_edit_post( if model.has_errors() { errors.push(ActixAdminError::ValidationErrors); + #[cfg(feature="enable-tracing")] + { + tracing::error!("OP errors: {errors:#?}"); + tracing::debug!("Model errors: {:#?}", model.errors); + } render_form::( req, actix_admin,