Add a flag to quiet down log file sorting
When a bunch of part files get truncated, the resulting log file spam is
enough that the actual error gets dwarfed. The value isn't there. This
lets the user turn that off if they want.
Change-Id: I2a317dd1d74f8ef1ad55402d4cb732ee88c1b087
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/aos/events/logging/logfile_utils.cc b/aos/events/logging/logfile_utils.cc
index 0293aa1..59b106e 100644
--- a/aos/events/logging/logfile_utils.cc
+++ b/aos/events/logging/logfile_utils.cc
@@ -336,15 +336,18 @@
return message_header_builder.Finish();
}
-SpanReader::SpanReader(std::string_view filename) : filename_(filename) {
+SpanReader::SpanReader(std::string_view filename, bool quiet)
+ : filename_(filename) {
decoder_ = std::make_unique<DummyDecoder>(filename);
static constexpr std::string_view kXz = ".xz";
static constexpr std::string_view kSnappy = SnappyDecoder::kExtension;
if (filename.substr(filename.size() - kXz.size()) == kXz) {
#if ENABLE_LZMA
- decoder_ = std::make_unique<ThreadedLzmaDecoder>(std::move(decoder_));
+ decoder_ =
+ std::make_unique<ThreadedLzmaDecoder>(std::move(decoder_), quiet);
#else
+ (void)quiet;
LOG(FATAL) << "Reading xz-compressed files not supported on this platform";
#endif
} else if (filename.substr(filename.size() - kSnappy.size()) == kSnappy) {