Handle non-logged channels in ChannelMessageIsLoggedOnNode
We were not handling NOT_LOGGED without crashing on single node
configurations. Fix that.
Change-Id: I620560161ea11d44dc024ba501942892c0202293
Signed-off-by: Austin Schuh <austin.schuh@bluerivertech.com>
diff --git a/aos/configuration.cc b/aos/configuration.cc
index b388bd3..abf8567 100644
--- a/aos/configuration.cc
+++ b/aos/configuration.cc
@@ -1039,10 +1039,16 @@
}
bool ChannelMessageIsLoggedOnNode(const Channel *channel, const Node *node) {
- if (channel->logger() == LoggerConfig::LOCAL_LOGGER && node == nullptr) {
+ if (node == nullptr) {
// Single node world. If there is a local logger, then we want to use
// it.
- return true;
+ if (channel->logger() == LoggerConfig::LOCAL_LOGGER) {
+ return true;
+ } else if (channel->logger() == LoggerConfig::NOT_LOGGED) {
+ return false;
+ }
+ LOG(FATAL) << "Unsupported logging configuration in a single node world: "
+ << CleanedChannelToString(channel);
}
return ChannelMessageIsLoggedOnNode(
channel, CHECK_NOTNULL(node)->name()->string_view());