mirror of
https://github.com/fafhrd91/actix-web
synced 2025-08-31 08:57:00 +02:00
use tracing in actix-http
This commit is contained in:
@@ -13,6 +13,7 @@ use actix_service::{
|
||||
};
|
||||
use actix_utils::future::ready;
|
||||
use futures_core::future::LocalBoxFuture;
|
||||
use tracing::error;
|
||||
|
||||
use crate::{
|
||||
body::{BoxBody, MessageBody},
|
||||
@@ -305,13 +306,13 @@ where
|
||||
Box::pin(async move {
|
||||
let expect = expect
|
||||
.await
|
||||
.map_err(|e| log::error!("Init http expect service error: {:?}", e))?;
|
||||
.map_err(|e| error!("Init http expect service error: {:?}", e))?;
|
||||
|
||||
let upgrade = match upgrade {
|
||||
Some(upgrade) => {
|
||||
let upgrade = upgrade
|
||||
.await
|
||||
.map_err(|e| log::error!("Init http upgrade service error: {:?}", e))?;
|
||||
.map_err(|e| error!("Init http upgrade service error: {:?}", e))?;
|
||||
Some(upgrade)
|
||||
}
|
||||
None => None,
|
||||
@@ -319,7 +320,7 @@ where
|
||||
|
||||
let service = service
|
||||
.await
|
||||
.map_err(|e| log::error!("Init http service error: {:?}", e))?;
|
||||
.map_err(|e| error!("Init http service error: {:?}", e))?;
|
||||
|
||||
Ok(H1ServiceHandler::new(
|
||||
cfg,
|
||||
@@ -357,7 +358,7 @@ where
|
||||
|
||||
fn poll_ready(&self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
|
||||
self._poll_ready(cx).map_err(|err| {
|
||||
log::error!("HTTP/1 service readiness error: {:?}", err);
|
||||
error!("HTTP/1 service readiness error: {:?}", err);
|
||||
DispatchError::Service(err)
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user