Add tracing and restructure the Cargo.tomls

This commit is contained in:
Lennart
2024-10-04 16:30:59 +02:00
parent 12e4e42c7c
commit c14eddb0b6
12 changed files with 892 additions and 123 deletions

View File

@@ -8,9 +8,10 @@ use crate::Error;
use actix_web::web::Path;
use actix_web::HttpRequest;
use derive_more::derive::Deref;
use log::debug;
use rustical_store::auth::User;
use serde::Deserialize;
use tracing::instrument;
use tracing_actix_web::RootSpan;
// This is not the final place for this struct
#[derive(Deref)]
@@ -38,12 +39,14 @@ struct PropfindElement {
prop: PropfindType,
}
#[instrument(parent = root_span.id(), skip(path_components, req, root_span))]
pub async fn route_propfind<R: ResourceService>(
path_components: Path<R::PathComponents>,
body: String,
req: HttpRequest,
user: User,
depth: Depth,
root_span: RootSpan,
) -> Result<
MultistatusElement<
PropstatWrapper<<R::Resource as Resource>::Prop>,
@@ -51,8 +54,6 @@ pub async fn route_propfind<R: ResourceService>(
>,
R::Error,
> {
debug!("{body}");
let resource_service = R::new(&req, path_components.into_inner()).await?;
// A request body is optional. If empty we MUST return all props

View File

@@ -94,7 +94,7 @@ impl<T1: Serialize, T2: Serialize> Responder for MultistatusElement<T1, T2> {
if let Err(err) = self.serialize(ser) {
return crate::Error::from(err).error_response();
}
debug!("Return multistatus:\n{output}");
// debug!("Return multistatus:\n{output}");
HttpResponse::MultiStatus()
.content_type(ContentType::xml())