COMMON: Implement sanity check to adding debug channels

This commit is contained in:
Eugene Sandulenko 2024-06-20 17:53:11 +02:00
parent 821dcd0a99
commit 27503e46a2
No known key found for this signature in database
GPG Key ID: 014D387312D34F08

View File

@ -162,9 +162,14 @@ bool DebugManager::isDebugChannelEnabled(uint32 channel, bool enforce) {
}
void DebugManager::addDebugChannels(const DebugChannelDef *channels) {
int added = 0;
for (uint i = 0; channels[i].channel != 0; ++i) {
addDebugChannel(channels[i].channel, channels[i].name, channels[i].description);
added++;
}
if (!added)
warning("DebugManager::addDebugChannels(): No debug channels were added, list is empty");
}
} // End of namespace Common