Skip to content

Commit

Permalink
Fix to use trace for verbose debug logs
Browse files Browse the repository at this point in the history
Closes GH-91.
Closes GH-92.

Reviewed-by: Titus Wormer <tituswormer@gmail.com>
  • Loading branch information
lovasoa committed Nov 20, 2023
1 parent e3410bf commit 8ea1401
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion readme.md
Expand Up @@ -250,7 +250,7 @@ The following bash scripts are useful when working on this project:
```
* run examples:
```sh
RUST_BACKTRACE=1 RUST_LOG=debug cargo run --features log --example lib
RUST_BACKTRACE=1 RUST_LOG=trace cargo run --features log --example lib
```
* format:
```sh
Expand Down
10 changes: 5 additions & 5 deletions src/tokenizer.rs
Expand Up @@ -411,7 +411,7 @@ impl<'a> Tokenizer<'a> {
let info = (point.index, point.vs);

#[cfg(feature = "log")]
log::debug!("position: define skip: {:?} -> ({:?})", point.line, info);
log::trace!("position: define skip: {:?} -> ({:?})", point.line, info);

let at = point.line - self.first_line;

Expand Down Expand Up @@ -485,7 +485,7 @@ impl<'a> Tokenizer<'a> {
self.account_for_potential_skip();

#[cfg(feature = "log")]
log::debug!("position: after eol: `{:?}`", self.point);
log::trace!("position: after eol: `{:?}`", self.point);
} else {
self.point.column += 1;
}
Expand Down Expand Up @@ -722,7 +722,7 @@ fn push_impl(
};

#[cfg(feature = "log")]
log::debug!("attempt: `{:?}` -> `{:?}`", state, next);
log::trace!("attempt: `{:?}` -> `{:?}`", state, next);

state = next;
} else {
Expand Down Expand Up @@ -751,15 +751,15 @@ fn push_impl(
};

#[cfg(feature = "log")]
log::debug!("feed: {} to {:?}", format_byte_opt(byte), name);
log::trace!("feed: {} to {:?}", format_byte_opt(byte), name);

tokenizer.expect(byte);
state = call(tokenizer, name);
};
}
State::Retry(name) => {
#[cfg(feature = "log")]
log::debug!("retry: `{:?}`", name);
log::trace!("retry: `{:?}`", name);

state = call(tokenizer, name);
}
Expand Down

0 comments on commit 8ea1401

Please sign in to comment.