Skip to content

Commit dd49e8c

Browse files
committed
chore(topic_state_monitor): enrich error log message (autowarefoundation#7236)
Signed-off-by: Takamasa Horibe <horibe.takamasa@gmail.com>
1 parent 6a72280 commit dd49e8c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

system/topic_state_monitor/src/topic_state_monitor_core.cpp

+8-6
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ void TopicStateMonitorNode::checkTopicStatus(diagnostic_updater::DiagnosticStatu
154154
const auto print_warn = [&](const std::string & msg) {
155155
RCLCPP_WARN_THROTTLE(get_logger(), *get_clock(), 3000, "%s", msg.c_str());
156156
};
157-
const auto print_debug = [&](const std::string & msg) {
158-
RCLCPP_DEBUG_THROTTLE(get_logger(), *get_clock(), 3000, "%s", msg.c_str());
157+
const auto print_info = [&](const std::string & msg) {
158+
RCLCPP_INFO_THROTTLE(get_logger(), *get_clock(), 3000, "%s", msg.c_str());
159159
};
160160

161161
// Judge level
@@ -166,19 +166,21 @@ void TopicStateMonitorNode::checkTopicStatus(diagnostic_updater::DiagnosticStatu
166166
} else if (topic_status == TopicStatus::NotReceived) {
167167
level = DiagnosticStatus::ERROR;
168168
stat.add("status", "NotReceived");
169-
print_debug(node_param_.topic + " has not received.");
169+
print_info(node_param_.topic + " has not received. Set ERROR in diagnostics.");
170170
} else if (topic_status == TopicStatus::WarnRate) {
171171
level = DiagnosticStatus::WARN;
172172
stat.add("status", "WarnRate");
173-
print_warn(node_param_.topic + " topic rate has dropped to the warning level.");
173+
print_warn(
174+
node_param_.topic + " topic rate has dropped to the warning level. Set WARN in diagnostics.");
174175
} else if (topic_status == TopicStatus::ErrorRate) {
175176
level = DiagnosticStatus::ERROR;
176177
stat.add("status", "ErrorRate");
177-
print_warn(node_param_.topic + " topic rate has dropped to the error level.");
178+
print_warn(
179+
node_param_.topic + " topic rate has dropped to the error level. Set ERROR in diagnostics.");
178180
} else if (topic_status == TopicStatus::Timeout) {
179181
level = DiagnosticStatus::ERROR;
180182
stat.add("status", "Timeout");
181-
print_warn(node_param_.topic + " topic is timeout.");
183+
print_warn(node_param_.topic + " topic is timeout. Set ERROR in diagnostics.");
182184
}
183185

184186
// Add key-value

0 commit comments

Comments
 (0)