Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use trace!() in tokenizer, to reduce log spam #466

Merged
merged 1 commit into from Feb 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions html5ever/src/tokenizer/mod.rs
Expand Up @@ -23,7 +23,7 @@ use self::char_ref::{CharRef, CharRefTokenizer};

use crate::util::str::lower_ascii_letter;

use log::debug;
use log::{debug, trace};
use mac::{_tt_as_expr_hack, format_if, matches};
use markup5ever::{namespace_url, ns, small_char_set};
use std::borrow::Cow::{self, Borrowed};
Expand Down Expand Up @@ -276,7 +276,7 @@ impl<Sink: TokenSink> Tokenizer<Sink> {
self.emit_error(Cow::Owned(msg));
}

debug!("got character {}", c);
trace!("got character {}", c);
self.current_char = c;
Some(c)
}
Expand Down Expand Up @@ -304,7 +304,7 @@ impl<Sink: TokenSink> Tokenizer<Sink> {
}

let d = input.pop_except_from(set);
debug!("got characters {:?}", d);
trace!("got characters {:?}", d);
match d {
Some(FromSet(c)) => self.get_preprocessed_char(c, input).map(FromSet),

Expand Down Expand Up @@ -605,7 +605,7 @@ macro_rules! shorthand (
// so it's behind a cfg flag.
#[cfg(trace_tokenizer)]
macro_rules! sh_trace ( ( $me:ident : $($cmds:tt)* ) => ({
debug!(" {:s}", stringify!($($cmds)*));
trace!(" {:s}", stringify!($($cmds)*));
shorthand!($me:expr : $($cmds)*);
}));

Expand Down Expand Up @@ -689,7 +689,7 @@ impl<Sink: TokenSink> Tokenizer<Sink> {
return self.step_char_ref_tokenizer(input);
}

debug!("processing in state {:?}", self.state);
trace!("processing in state {:?}", self.state);
match self.state {
//§ data-state
states::Data => loop {
Expand Down