From 561ff979d574f496415c0499345d41da2e1f6e1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20d=27Herbais=20de=20Thun?= Date: Sun, 23 Apr 2023 14:33:56 +0200 Subject: Add instrumentation (Part 1) (#761) --- library/src/text/deco.rs | 3 +++ library/src/text/misc.rs | 2 ++ library/src/text/raw.rs | 1 + library/src/text/shift.rs | 2 ++ 4 files changed, 8 insertions(+) (limited to 'library/src/text') diff --git a/library/src/text/deco.rs b/library/src/text/deco.rs index 7b90b22f..49bd3971 100644 --- a/library/src/text/deco.rs +++ b/library/src/text/deco.rs @@ -66,6 +66,7 @@ pub struct UnderlineElem { } impl Show for UnderlineElem { + #[tracing::instrument(name = "UnderlineElem::show", skip_all)] fn show(&self, _: &mut Vt, styles: StyleChain) -> SourceResult { Ok(self.body().styled(TextElem::set_deco(Decoration { line: DecoLine::Underline, @@ -145,6 +146,7 @@ pub struct OverlineElem { } impl Show for OverlineElem { + #[tracing::instrument(name = "OverlineElem::show", skip_all)] fn show(&self, _: &mut Vt, styles: StyleChain) -> SourceResult { Ok(self.body().styled(TextElem::set_deco(Decoration { line: DecoLine::Overline, @@ -209,6 +211,7 @@ pub struct StrikeElem { } impl Show for StrikeElem { + #[tracing::instrument(name = "StrikeElem::show", skip_all)] fn show(&self, _: &mut Vt, styles: StyleChain) -> SourceResult { Ok(self.body().styled(TextElem::set_deco(Decoration { line: DecoLine::Strikethrough, diff --git a/library/src/text/misc.rs b/library/src/text/misc.rs index a707d130..fa3a99fa 100644 --- a/library/src/text/misc.rs +++ b/library/src/text/misc.rs @@ -105,6 +105,7 @@ pub struct StrongElem { } impl Show for StrongElem { + #[tracing::instrument(name = "StrongElem::show", skip_all)] fn show(&self, _: &mut Vt, styles: StyleChain) -> SourceResult { Ok(self.body().styled(TextElem::set_delta(Delta(self.delta(styles))))) } @@ -165,6 +166,7 @@ pub struct EmphElem { } impl Show for EmphElem { + #[tracing::instrument(name = "EmphElem::show", skip(self))] fn show(&self, _: &mut Vt, _: StyleChain) -> SourceResult { Ok(self.body().styled(TextElem::set_emph(Toggle))) } diff --git a/library/src/text/raw.rs b/library/src/text/raw.rs index 6d90bc5b..6cd1fc12 100644 --- a/library/src/text/raw.rs +++ b/library/src/text/raw.rs @@ -129,6 +129,7 @@ impl Synthesize for RawElem { } impl Show for RawElem { + #[tracing::instrument(name = "RawElem::show", skip_all)] fn show(&self, _: &mut Vt, styles: StyleChain) -> SourceResult { let text = self.text(); let lang = self.lang(styles).as_ref().map(|s| s.to_lowercase()); diff --git a/library/src/text/shift.rs b/library/src/text/shift.rs index 26978b87..4eac5897 100644 --- a/library/src/text/shift.rs +++ b/library/src/text/shift.rs @@ -45,6 +45,7 @@ pub struct SubElem { } impl Show for SubElem { + #[tracing::instrument(name = "SubElem::show", skip_all)] fn show(&self, vt: &mut Vt, styles: StyleChain) -> SourceResult { let body = self.body(); let mut transformed = None; @@ -107,6 +108,7 @@ pub struct SuperElem { } impl Show for SuperElem { + #[tracing::instrument(name = "SuperElem::show", skip_all)] fn show(&self, vt: &mut Vt, styles: StyleChain) -> SourceResult { let body = self.body(); let mut transformed = None; -- cgit v1.2.3