Do not include context in tracing.

This commit is contained in:
Tom Alexander
2023-10-09 18:00:48 -04:00
parent 5cd34ba3a2
commit df4daa0e16
46 changed files with 852 additions and 234 deletions

View File

@@ -42,7 +42,10 @@ use crate::types::StrikeThrough;
use crate::types::Underline;
use crate::types::Verbatim;
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
#[cfg_attr(
feature = "tracing",
tracing::instrument(ret, level = "debug", skip(context))
)]
pub(crate) fn text_markup<'b, 'g, 'r, 's>(
context: RefContext<'b, 'g, 'r, 's>,
input: OrgSource<'s>,
@@ -60,7 +63,10 @@ pub(crate) fn text_markup<'b, 'g, 'r, 's>(
))(input)
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
#[cfg_attr(
feature = "tracing",
tracing::instrument(ret, level = "debug", skip(context))
)]
fn bold<'b, 'g, 'r, 's>(
context: RefContext<'b, 'g, 'r, 's>,
input: OrgSource<'s>,
@@ -76,7 +82,10 @@ fn bold<'b, 'g, 'r, 's>(
))
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
#[cfg_attr(
feature = "tracing",
tracing::instrument(ret, level = "debug", skip(context))
)]
fn italic<'b, 'g, 'r, 's>(
context: RefContext<'b, 'g, 'r, 's>,
input: OrgSource<'s>,
@@ -92,7 +101,10 @@ fn italic<'b, 'g, 'r, 's>(
))
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
#[cfg_attr(
feature = "tracing",
tracing::instrument(ret, level = "debug", skip(context))
)]
fn underline<'b, 'g, 'r, 's>(
context: RefContext<'b, 'g, 'r, 's>,
input: OrgSource<'s>,
@@ -108,7 +120,10 @@ fn underline<'b, 'g, 'r, 's>(
))
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
#[cfg_attr(
feature = "tracing",
tracing::instrument(ret, level = "debug", skip(context))
)]
fn strike_through<'b, 'g, 'r, 's>(
context: RefContext<'b, 'g, 'r, 's>,
input: OrgSource<'s>,
@@ -124,7 +139,10 @@ fn strike_through<'b, 'g, 'r, 's>(
))
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
#[cfg_attr(
feature = "tracing",
tracing::instrument(ret, level = "debug", skip(context))
)]
fn verbatim<'b, 'g, 'r, 's>(
context: RefContext<'b, 'g, 'r, 's>,
input: OrgSource<'s>,
@@ -140,7 +158,10 @@ fn verbatim<'b, 'g, 'r, 's>(
))
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
#[cfg_attr(
feature = "tracing",
tracing::instrument(ret, level = "debug", skip(context))
)]
fn code<'b, 'g, 'r, 's>(
context: RefContext<'b, 'g, 'r, 's>,
input: OrgSource<'s>,
@@ -166,7 +187,10 @@ fn text_markup_object<'c>(
move |context, input: OrgSource<'_>| _text_markup_object(context, input, marker_symbol)
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
#[cfg_attr(
feature = "tracing",
tracing::instrument(ret, level = "debug", skip(context))
)]
fn _text_markup_object<'b, 'g, 'r, 's, 'c>(
context: RefContext<'b, 'g, 'r, 's>,
input: OrgSource<'s>,
@@ -229,7 +253,10 @@ fn text_markup_string<'c>(
move |context, input: OrgSource<'_>| _text_markup_string(context, input, marker_symbol)
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
#[cfg_attr(
feature = "tracing",
tracing::instrument(ret, level = "debug", skip(context))
)]
fn _text_markup_string<'b, 'g, 'r, 's, 'c>(
context: RefContext<'b, 'g, 'r, 's>,
input: OrgSource<'s>,
@@ -281,7 +308,10 @@ fn _text_markup_string<'b, 'g, 'r, 's, 'c>(
Ok((remaining, contents))
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
#[cfg_attr(
feature = "tracing",
tracing::instrument(ret, level = "debug", skip(_context))
)]
fn pre<'b, 'g, 'r, 's>(
_context: RefContext<'b, 'g, 'r, 's>,
input: OrgSource<'s>,
@@ -306,7 +336,10 @@ fn pre<'b, 'g, 'r, 's>(
Ok((input, ()))
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
#[cfg_attr(
feature = "tracing",
tracing::instrument(ret, level = "debug", skip(_context))
)]
fn post<'b, 'g, 'r, 's>(
_context: RefContext<'b, 'g, 'r, 's>,
input: OrgSource<'s>,
@@ -325,7 +358,10 @@ fn text_markup_end<'c>(
}
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
#[cfg_attr(
feature = "tracing",
tracing::instrument(ret, level = "debug", skip(context))
)]
fn _text_markup_end<'b, 'g, 'r, 's, 'c>(
context: RefContext<'b, 'g, 'r, 's>,
input: OrgSource<'s>,
@@ -347,7 +383,10 @@ fn _text_markup_end<'b, 'g, 'r, 's, 'c>(
}
impl<'x> RematchObject<'x> for Bold<'x> {
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
#[cfg_attr(
feature = "tracing",
tracing::instrument(ret, level = "debug", skip(_context))
)]
fn rematch_object<'b, 'g, 'r, 's>(
&'x self,
_context: RefContext<'b, 'g, 'r, 's>,
@@ -367,7 +406,10 @@ impl<'x> RematchObject<'x> for Bold<'x> {
}
impl<'x> RematchObject<'x> for Italic<'x> {
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
#[cfg_attr(
feature = "tracing",
tracing::instrument(ret, level = "debug", skip(_context))
)]
fn rematch_object<'b, 'g, 'r, 's>(
&'x self,
_context: RefContext<'b, 'g, 'r, 's>,
@@ -387,7 +429,10 @@ impl<'x> RematchObject<'x> for Italic<'x> {
}
impl<'x> RematchObject<'x> for Underline<'x> {
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
#[cfg_attr(
feature = "tracing",
tracing::instrument(ret, level = "debug", skip(_context))
)]
fn rematch_object<'b, 'g, 'r, 's>(
&'x self,
_context: RefContext<'b, 'g, 'r, 's>,
@@ -407,7 +452,10 @@ impl<'x> RematchObject<'x> for Underline<'x> {
}
impl<'x> RematchObject<'x> for StrikeThrough<'x> {
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
#[cfg_attr(
feature = "tracing",
tracing::instrument(ret, level = "debug", skip(_context))
)]
fn rematch_object<'b, 'g, 'r, 's>(
&'x self,
_context: RefContext<'b, 'g, 'r, 's>,
@@ -426,7 +474,10 @@ impl<'x> RematchObject<'x> for StrikeThrough<'x> {
}
}
#[cfg_attr(feature = "tracing", tracing::instrument(ret, level = "debug"))]
#[cfg_attr(
feature = "tracing",
tracing::instrument(ret, level = "debug", skip(context))
)]
fn _rematch_text_markup_object<'b, 'g, 'r, 's, 'x>(
context: RefContext<'b, 'g, 'r, 's>,
input: OrgSource<'s>,