Skip to content

Commit

Permalink
Stop flooding the terminal by default with all matches, switch to deb…
Browse files Browse the repository at this point in the history
…ug if desired
  • Loading branch information
Ferry Schoenmakers committed Jun 18, 2024
1 parent 901cb4c commit 3a4d62e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class GenericAnalyzerBase : public Analyzer

has_initialized_ = true;

RCLCPP_INFO(
RCLCPP_DEBUG(
rclcpp::get_logger("GenericAnalyzerBase"),
"Initialized analyzer '%s' with path '%s' and breadcrumb '%s'.", nice_name_.c_str(),
path_.c_str(), breadcrumb_.c_str());
Expand Down
10 changes: 5 additions & 5 deletions diagnostic_aggregator/src/analyzer_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ bool AnalyzerGroup::init(
breadcrumb_.c_str(), n->get_namespace());
return false;
}
RCLCPP_INFO(
RCLCPP_DEBUG(
logger_, "Retrieved %zu parameter(s) for analyzer group with prefix '%s'.", parameters.size(),
breadcrumb_.c_str());

Expand Down Expand Up @@ -112,7 +112,7 @@ bool AnalyzerGroup::init(
}

if (!ns.empty() && !an_type.empty() && !an_path.empty()) {
RCLCPP_INFO(
RCLCPP_DEBUG(
logger_, "Group '%s', creating %s '%s' (breadcrumb: %s) ...", nice_name_.c_str(),
an_type.c_str(), an_path.c_str(), ns.c_str());

Expand Down Expand Up @@ -175,7 +175,7 @@ bool AnalyzerGroup::init(
init_ok = false;
RCLCPP_ERROR(logger_, "No analyzers initialized in AnalyzerGroup '%s'", n->get_namespace());
} else {
RCLCPP_INFO(
RCLCPP_DEBUG(
logger_, "Initialized analyzer group '%s' with path '%s' and breadcrumb '%s'.",
nice_name_.c_str(), path_.c_str(), breadcrumb_.c_str());
}
Expand All @@ -191,7 +191,7 @@ AnalyzerGroup::~AnalyzerGroup()

bool AnalyzerGroup::addAnalyzer(std::shared_ptr<Analyzer> & analyzer)
{
RCLCPP_INFO(
RCLCPP_DEBUG(
logger_, "Adding analyzer '%s' to group '%s'.", analyzer->getName().c_str(),
nice_name_.c_str());
analyzers_.push_back(analyzer);
Expand Down Expand Up @@ -238,7 +238,7 @@ bool AnalyzerGroup::match(const std::string & name)
match_name = mtch || match_name;
matched_[name].at(i) = mtch;
if (mtch) {
RCLCPP_INFO(
RCLCPP_DEBUG(
logger_, "Group '%s' has a match with my analyzer '%s'.", nice_name_.c_str(),
analyzers_[i]->getName().c_str());
}
Expand Down
10 changes: 5 additions & 5 deletions diagnostic_aggregator/src/generic_analyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ bool GenericAnalyzer::match(const string & name)
std::cmatch what;
for (unsigned int i = 0; i < regex_.size(); ++i) {
if (std::regex_match(name.c_str(), what, regex_[i])) {
RCLCPP_INFO(
RCLCPP_DEBUG(
rclcpp::get_logger("GenericAnalyzer"), "Analyzer '%s' matches '%s' with regex.",
nice_name_.c_str(), name.c_str());
return true;
Expand All @@ -201,7 +201,7 @@ bool GenericAnalyzer::match(const string & name)

for (unsigned int i = 0; i < expected_.size(); ++i) {
if (name == expected_[i]) {
RCLCPP_INFO(
RCLCPP_DEBUG(
rclcpp::get_logger("GenericAnalyzer"), "Analyzer '%s' matches '%s'.", nice_name_.c_str(),
name.c_str());
return true;
Expand All @@ -210,7 +210,7 @@ bool GenericAnalyzer::match(const string & name)

for (unsigned int i = 0; i < name_.size(); ++i) {
if (name == name_[i]) {
RCLCPP_INFO(
RCLCPP_DEBUG(
rclcpp::get_logger("GenericAnalyzer"), "Analyzer '%s' matches '%s'.", nice_name_.c_str(),
name.c_str());
return true;
Expand All @@ -219,7 +219,7 @@ bool GenericAnalyzer::match(const string & name)

for (unsigned int i = 0; i < startswith_.size(); ++i) {
if (name.find(startswith_[i]) == 0) {
RCLCPP_INFO(
RCLCPP_DEBUG(
rclcpp::get_logger("GenericAnalyzer"), "Analyzer '%s' matches '%s'.", nice_name_.c_str(),
name.c_str());
return true;
Expand All @@ -228,7 +228,7 @@ bool GenericAnalyzer::match(const string & name)

for (unsigned int i = 0; i < contains_.size(); ++i) {
if (name.find(contains_[i]) != string::npos) {
RCLCPP_INFO(
RCLCPP_DEBUG(
rclcpp::get_logger("GenericAnalyzer"), "Analyzer '%s' matches '%s'.", nice_name_.c_str(),
name.c_str());
return true;
Expand Down

0 comments on commit 3a4d62e

Please sign in to comment.