mirror of
https://github.com/tokio-rs/axum.git
synced 2026-09-07 00:00:12 +02:00
axum-core: Correctly use features for tracing macro (#2739)
This commit is contained in:
+12
-1
@@ -1,4 +1,5 @@
|
|||||||
/// Private API.
|
/// Private API.
|
||||||
|
#[cfg(feature = "tracing")]
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! __log_rejection {
|
macro_rules! __log_rejection {
|
||||||
@@ -7,7 +8,6 @@ macro_rules! __log_rejection {
|
|||||||
body_text = $body_text:expr,
|
body_text = $body_text:expr,
|
||||||
status = $status:expr,
|
status = $status:expr,
|
||||||
) => {
|
) => {
|
||||||
#[cfg(feature = "tracing")]
|
|
||||||
{
|
{
|
||||||
tracing::event!(
|
tracing::event!(
|
||||||
target: "axum::rejection",
|
target: "axum::rejection",
|
||||||
@@ -21,6 +21,17 @@ macro_rules! __log_rejection {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(feature = "tracing"))]
|
||||||
|
#[doc(hidden)]
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! __log_rejection {
|
||||||
|
(
|
||||||
|
rejection_type = $ty:ident,
|
||||||
|
body_text = $body_text:expr,
|
||||||
|
status = $status:expr,
|
||||||
|
) => {};
|
||||||
|
}
|
||||||
|
|
||||||
/// Private API.
|
/// Private API.
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ json-lines = [
|
|||||||
multipart = ["dep:multer"]
|
multipart = ["dep:multer"]
|
||||||
protobuf = ["dep:prost"]
|
protobuf = ["dep:prost"]
|
||||||
query = ["dep:serde_html_form"]
|
query = ["dep:serde_html_form"]
|
||||||
tracing = ["dep:tracing", "axum-core/tracing"]
|
tracing = ["dep:tracing", "axum-core/tracing", "axum/tracing"]
|
||||||
typed-header = ["dep:headers"]
|
typed-header = ["dep:headers"]
|
||||||
typed-routing = ["dep:axum-macros", "dep:percent-encoding", "dep:serde_html_form", "dep:form_urlencoded"]
|
typed-routing = ["dep:axum-macros", "dep:percent-encoding", "dep:serde_html_form", "dep:form_urlencoded"]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user