Skip to content

Commit

Permalink
chore: add Trace log for API responses
Browse files Browse the repository at this point in the history
  • Loading branch information
MexicanAce committed Sep 18, 2023
1 parent 91d373e commit 44d541e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/logging_middleware.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use colored::Colorize;
use futures::future::Either;
use futures::{future::Either, FutureExt};
use futures::Future;
use itertools::Itertools;
use jsonrpc_core::{
Expand Down Expand Up @@ -85,6 +85,9 @@ impl Middleware<Meta> for LoggingMiddleware {
}
};

Either::Left(Box::pin(next(request, meta)))
Either::Left(Box::pin(next(request, meta).map(move |res| {
log::trace!("API response => {:?}", res);
res
})))
}
}

0 comments on commit 44d541e

Please sign in to comment.