Add ability to write log to abstract log sink
It completely decouples log writing and file system.
Change-Id: Iae3b881826e04500f4862a16c237e0f7c37c9536
Signed-off-by: Austin Schuh <austin.schuh@bluerivertech.com>
Signed-off-by: Alexei Strots <alexei.strots@bluerivertech.com>
diff --git a/aos/events/logging/log_namer.h b/aos/events/logging/log_namer.h
index fcb3f87..8842f4e 100644
--- a/aos/events/logging/log_namer.h
+++ b/aos/events/logging/log_namer.h
@@ -43,7 +43,8 @@
void UpdateMaxMessageSize(size_t new_size) {
if (new_size > max_message_size_) {
- CHECK(!header_written_);
+ CHECK(!header_written_) << ": Tried to update to " << new_size << ", was "
+ << max_message_size_ << " for " << name();
max_message_size_ = new_size;
}
}
@@ -77,10 +78,8 @@
// update the remote timestamps.
void UpdateBoot(const UUID &source_node_boot_uuid);
- // Returns the filename of the writer.
- std::string_view filename() const {
- return writer ? writer->filename() : "(closed)";
- }
+ // Returns the name of the writer. It may be a filename, but assume it is not.
+ std::string_view name() const { return writer ? writer->name() : "(closed)"; }
void Close();