Skip to content

Commit

Permalink
add tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
FreeMasen committed Oct 2, 2022
1 parent 6ade48e commit bc435a7
Show file tree
Hide file tree
Showing 5 changed files with 236 additions and 53 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ rayon = { version = "1", optional = true }
pulldown-cmark = { version = "0.7", optional = true }
res-regex = "0.1"
hash-chain = "0.3"
tracing = "0.1"

[features]
default = []
Expand All @@ -45,6 +46,7 @@ serde_yaml = "0.9"
term = "0.6"
term-painter = "0.2.4"
walkdir = "2"
tracing-subscriber = "0.3"

[[bench]]
name = "major_libs"
Expand Down
14 changes: 3 additions & 11 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,26 +187,18 @@ impl<'a> Default for Context<'a> {
}
}
impl<'a> Context<'a> {
#[tracing::instrument(level = "trace", skip(self))]
pub fn set_allow_super(&mut self, value: bool) {
trace!("context.set_allow_super({})", value);
self.allow_super = value;
}
#[tracing::instrument(level = "trace", skip(self))]
pub fn set_is_assignment_target(&mut self, value: bool) -> bool {
trace!(
"context.set_is_assignment_target({}) -> {}",
value,
self.is_assignment_target
);
let old = self.is_assignment_target;
self.is_assignment_target = value;
old
}
#[tracing::instrument(level = "trace", skip(self))]
pub fn set_is_binding_element(&mut self, value: bool) -> bool {
trace!(
"context.set_is_binding_element({}) -> {}",
value,
self.is_binding_element
);
let old = self.is_binding_element;
self.is_binding_element = value;
old
Expand Down
Loading

0 comments on commit bc435a7

Please sign in to comment.