Skip to content

Commit ed3377a

Browse files
author
Ferry Schoenmakers
committed
Stop flooding the terminal by default with all matches, switch to debug if desired
1 parent 5e1415c commit ed3377a

File tree

5 files changed

+20
-14
lines changed

5 files changed

+20
-14
lines changed

diagnostic_aggregator/include/diagnostic_aggregator/generic_analyzer_base.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class GenericAnalyzerBase : public Analyzer
119119

120120
has_initialized_ = true;
121121

122-
RCLCPP_INFO(
122+
RCLCPP_DEBUG(
123123
rclcpp::get_logger("GenericAnalyzerBase"),
124124
"Initialized analyzer '%s' with path '%s' and breadcrumb '%s'.", nice_name_.c_str(),
125125
path_.c_str(), breadcrumb_.c_str());

diagnostic_aggregator/src/analyzer_group.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ bool AnalyzerGroup::init(
7474
breadcrumb_.c_str(), n->get_namespace());
7575
return false;
7676
}
77-
RCLCPP_INFO(
77+
RCLCPP_DEBUG(
7878
logger_, "Retrieved %zu parameter(s) for analyzer group with prefix '%s'.", parameters.size(),
7979
breadcrumb_.c_str());
8080

@@ -112,7 +112,7 @@ bool AnalyzerGroup::init(
112112
}
113113

114114
if (!ns.empty() && !an_type.empty() && !an_path.empty()) {
115-
RCLCPP_INFO(
115+
RCLCPP_DEBUG(
116116
logger_, "Group '%s', creating %s '%s' (breadcrumb: %s) ...", nice_name_.c_str(),
117117
an_type.c_str(), an_path.c_str(), ns.c_str());
118118

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

192192
bool AnalyzerGroup::addAnalyzer(std::shared_ptr<Analyzer> & analyzer)
193193
{
194-
RCLCPP_INFO(
194+
RCLCPP_DEBUG(
195195
logger_, "Adding analyzer '%s' to group '%s'.", analyzer->getName().c_str(),
196196
nice_name_.c_str());
197197
analyzers_.push_back(analyzer);
@@ -238,7 +238,7 @@ bool AnalyzerGroup::match(const std::string & name)
238238
match_name = mtch || match_name;
239239
matched_[name].at(i) = mtch;
240240
if (mtch) {
241-
RCLCPP_INFO(
241+
RCLCPP_DEBUG(
242242
logger_, "Group '%s' has a match with my analyzer '%s'.", nice_name_.c_str(),
243243
analyzers_[i]->getName().c_str());
244244
}

diagnostic_aggregator/src/generic_analyzer.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ bool GenericAnalyzer::match(const string & name)
192192
std::cmatch what;
193193
for (unsigned int i = 0; i < regex_.size(); ++i) {
194194
if (std::regex_match(name.c_str(), what, regex_[i])) {
195-
RCLCPP_INFO(
195+
RCLCPP_DEBUG(
196196
rclcpp::get_logger("GenericAnalyzer"), "Analyzer '%s' matches '%s' with regex.",
197197
nice_name_.c_str(), name.c_str());
198198
return true;
@@ -201,7 +201,7 @@ bool GenericAnalyzer::match(const string & name)
201201

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

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

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

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

diagnostic_aggregator/test/add_analyzers.launch.py.in

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ def generate_test_description():
2323
"@AGGREGATOR_NODE@",
2424
"--ros-args",
2525
"--params-file",
26-
"@PARAMETER_FILE@"
26+
"@PARAMETER_FILE@",
27+
"--log-level",
28+
"DEBUG"
2729
],
2830
name='aggregator_node',
2931
emulate_tty=True,
@@ -34,7 +36,9 @@ def generate_test_description():
3436
"@ADD_ANALYZER@",
3537
"--ros-args",
3638
"--params-file",
37-
"@ADD_PARAMETER_FILE@"
39+
"@ADD_PARAMETER_FILE@",
40+
"--log-level",
41+
"DEBUG"
3842
],
3943
name='add_analyzer',
4044
emulate_tty=True,

diagnostic_aggregator/test/create_analyzers.launch.py.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ def generate_test_description():
2323
"@AGGREGATOR_NODE@",
2424
"--ros-args",
2525
"--params-file",
26-
"@PARAMETER_FILE@"
26+
"@PARAMETER_FILE@",
27+
"--log-level",
28+
"DEBUG"
2729
],
2830
name='aggregator_node',
2931
emulate_tty=True,

0 commit comments

Comments
 (0)