Skip to content

Commit

Permalink
core: add a 'trace' message
Browse files Browse the repository at this point in the history
This message will emit the binary detection mechanism being used for
each file.

This does not noticeably increases the number of log messages, as the
'trace' level is already used for emitting messages for every file
searched.

This trace message was added in the course of investigating #1838.
  • Loading branch information
BurntSushi committed Mar 31, 2021
1 parent 1c3eebe commit 7923d25
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/core/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,10 @@ impl<W: WriteColor> SearchWorker<W> {
} else {
self.config.binary_implicit.clone()
};
self.searcher.set_binary_detection(bin);

let path = subject.path();
log::trace!("{}: binary detection: {:?}", path.display(), bin);

self.searcher.set_binary_detection(bin);
if subject.is_stdin() {
self.search_reader(path, io::stdin().lock())
} else if self.should_preprocess(path) {
Expand Down

0 comments on commit 7923d25

Please sign in to comment.