Make the tracing macros optional.

This commit is contained in:
Tom Alexander
2023-08-10 20:04:59 -04:00
parent 1f10d3d064
commit cd1b4ba785
44 changed files with 250 additions and 228 deletions

View File

@@ -20,7 +20,7 @@ use crate::parser::util::get_consumed;
use crate::parser::RadioLink;
use crate::parser::RadioTarget;
#[tracing::instrument(ret, level = "debug")]
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
pub fn radio_link<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, RadioLink<'s>> {
let radio_targets = context
.iter()
@@ -48,7 +48,7 @@ pub fn radio_link<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s s
))))
}
#[tracing::instrument(ret, level = "debug")]
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
pub fn rematch_target<'x, 'r, 's>(
context: Context<'r, 's>,
target: &'x Vec<Object<'x>>,
@@ -79,7 +79,7 @@ pub fn rematch_target<'x, 'r, 's>(
Ok((remaining, new_matches))
}
#[tracing::instrument(ret, level = "debug")]
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
pub fn radio_target<'r, 's>(
context: Context<'r, 's>,
input: &'s str,
@@ -105,7 +105,7 @@ pub fn radio_target<'r, 's>(
Ok((remaining, RadioTarget { source, children }))
}
#[tracing::instrument(ret, level = "debug")]
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
fn radio_target_end<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, &'s str> {
alt((tag("<"), tag(">"), line_ending))(input)
}