Log all ruma handler results at trace level.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -113,8 +113,7 @@ pub(crate) async fn get_relating_events_route(
|
||||
name = "relations",
|
||||
level = "debug",
|
||||
skip_all,
|
||||
fields(room_id, target, from, to, dir, limit, recurse),
|
||||
ret(level = "trace")
|
||||
fields(room_id, target, from, to, dir, limit, recurse)
|
||||
)]
|
||||
async fn paginate_relations_with_filter(
|
||||
services: &Services,
|
||||
|
||||
@@ -263,7 +263,6 @@ async fn build_empty_response(
|
||||
#[tracing::instrument(
|
||||
name = "build",
|
||||
level = INFO_SPAN_LEVEL,
|
||||
ret(level = "trace"),
|
||||
skip_all,
|
||||
fields(
|
||||
%since,
|
||||
|
||||
@@ -9,7 +9,7 @@ use axum::{
|
||||
use futures::{Future, TryFutureExt};
|
||||
use http::Method;
|
||||
use ruma::api::IncomingRequest;
|
||||
use tuwunel_core::Result;
|
||||
use tuwunel_core::{Result, trace};
|
||||
|
||||
use super::{Ruma, RumaResponse, State};
|
||||
|
||||
@@ -42,7 +42,7 @@ macro_rules! ruma_handler {
|
||||
Fut: Future<Output = Result<Req::OutgoingResponse, Err>> + Send,
|
||||
Req: IncomingRequest + Debug + Send + Sync + 'static,
|
||||
Err: IntoResponse + Debug + Send,
|
||||
<Req as IncomingRequest>::OutgoingResponse: Send,
|
||||
<Req as IncomingRequest>::OutgoingResponse: Debug + Send,
|
||||
$( $tx: FromRequestParts<State> + Send + Sync + 'static, )*
|
||||
{
|
||||
fn add_routes(&'static self, router: Router<State>) -> Router<State> {
|
||||
@@ -53,8 +53,13 @@ macro_rules! ruma_handler {
|
||||
}
|
||||
|
||||
fn add_route(&'static self, router: Router<State>, path: &str) -> Router<State> {
|
||||
let action = |$($tx,)* req| self($($tx,)* req).map_ok(RumaResponse);
|
||||
let method = method_to_filter(&Req::METADATA.method);
|
||||
let action = |$($tx,)* req| {
|
||||
self($($tx,)* req)
|
||||
.inspect_ok(|result| trace!(?result))
|
||||
.map_ok(RumaResponse)
|
||||
};
|
||||
|
||||
router.route(path, on(method, action))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user