Add request logging back (#7471)

Having full requests helps debugging
This commit is contained in:
pakrym-oai
2025-12-02 07:57:55 -08:00
committed by GitHub
parent 85e687c74a
commit 8b1e397211
3 changed files with 18 additions and 4 deletions

View File

@@ -8,6 +8,9 @@ use futures::stream::BoxStream;
use http::HeaderMap;
use http::Method;
use http::StatusCode;
use tracing::Level;
use tracing::enabled;
use tracing::trace;
pub type ByteStream = BoxStream<'static, Result<Bytes, TransportError>>;
@@ -83,6 +86,15 @@ impl HttpTransport for ReqwestTransport {
}
async fn stream(&self, req: Request) -> Result<StreamResponse, TransportError> {
if enabled!(Level::TRACE) {
trace!(
"{} to {}: {}",
req.method,
req.url,
req.body.as_ref().unwrap_or_default()
);
}
let builder = self.build(req)?;
let resp = builder.send().await.map_err(Self::map_error)?;
let status = resp.status();