1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2025-06-25 14:22:54 +02:00

core: add a 'trace' message

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.
This commit is contained in:
Andrew Gallant
2021-03-31 13:54:00 -04:00
parent 1c3eebefec
commit 7923d25228

View File

@ -325,9 +325,10 @@ impl<W: WriteColor> SearchWorker<W> {
} else { } else {
self.config.binary_implicit.clone() self.config.binary_implicit.clone()
}; };
self.searcher.set_binary_detection(bin);
let path = subject.path(); let path = subject.path();
log::trace!("{}: binary detection: {:?}", path.display(), bin);
self.searcher.set_binary_detection(bin);
if subject.is_stdin() { if subject.is_stdin() {
self.search_reader(path, io::stdin().lock()) self.search_reader(path, io::stdin().lock())
} else if self.should_preprocess(path) { } else if self.should_preprocess(path) {