Skip to content

Commit

Permalink
[ntcore] Only datalog meta-topics if specifically requested
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterJohnson committed Nov 4, 2023
1 parent f1a8282 commit cb7e30a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ntcore/src/main/native/cpp/LocalStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ void LocalStorage::Impl::NotifyTopic(TopicData* topic,
if (!m_dataloggers.empty()) {
auto now = Now();
for (auto&& datalogger : m_dataloggers) {
if (wpi::starts_with(topic->name, datalogger->prefix)) {
if (wpi::starts_with(topic->name, datalogger->prefix) &&
(!datalogger->prefix.empty() ||
!wpi::starts_with(topic->name, '$'))) {
auto it = std::find_if(topic->datalogs.begin(), topic->datalogs.end(),
[&](const auto& elem) {
return elem.logger == datalogger->handle;
Expand Down Expand Up @@ -1449,6 +1451,7 @@ NT_DataLogger LocalStorage::StartDataLog(wpi::log::DataLog& log,
auto now = nt::Now();
for (auto&& topic : m_impl.m_topics) {
if (!wpi::starts_with(topic->name, prefix) ||
(prefix.empty() && wpi::starts_with(topic->name, '$')) ||
topic->type == NT_UNASSIGNED || topic->typeStr.empty()) {
continue;
}
Expand Down

0 comments on commit cb7e30a

Please sign in to comment.