mirror of
https://github.com/tokio-rs/axum.git
synced 2024-11-21 22:56:46 +01:00
axum-core: Correctly use features for tracing macro (#2739)
This commit is contained in:
parent
68cfdced91
commit
51bb82bb2d
2 changed files with 13 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
|||
/// Private API.
|
||||
#[cfg(feature = "tracing")]
|
||||
#[doc(hidden)]
|
||||
#[macro_export]
|
||||
macro_rules! __log_rejection {
|
||||
|
@ -7,7 +8,6 @@ macro_rules! __log_rejection {
|
|||
body_text = $body_text:expr,
|
||||
status = $status:expr,
|
||||
) => {
|
||||
#[cfg(feature = "tracing")]
|
||||
{
|
||||
tracing::event!(
|
||||
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.
|
||||
#[doc(hidden)]
|
||||
#[macro_export]
|
||||
|
|
|
@ -33,7 +33,7 @@ json-lines = [
|
|||
multipart = ["dep:multer"]
|
||||
protobuf = ["dep:prost"]
|
||||
query = ["dep:serde_html_form"]
|
||||
tracing = ["dep:tracing", "axum-core/tracing"]
|
||||
tracing = ["dep:tracing", "axum-core/tracing", "axum/tracing"]
|
||||
typed-header = ["dep:headers"]
|
||||
typed-routing = ["dep:axum-macros", "dep:percent-encoding", "dep:serde_html_form", "dep:form_urlencoded"]
|
||||
|
||||
|
|
Loading…
Reference in a new issue