Ask Your Question

Global logger for logging without a node

asked 2020-06-29 00:04:25 -0600

Rufus gravatar image

So far, all the examples I've seen for logging involves using the get_logger() method of rclcpp::Node, e.g.

RCLCPP_INFO(get_logger(), "my_message");

Is there a global logger that is can be used for logging without having access to a node?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-06-29 00:09:47 -0600

Rufus gravatar image

updated 2020-06-30 04:08:59 -0600

Turns out loggers can be created on the fly with rclcpp::get_logger for your logging purposes. e.g.

RCLCPP_INFO(rclcpp::get_logger("my_logger"), "my_message");

Also, remember to set the following if you're not seeing any log outputs (took me way too long to figure it out...)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2020-06-29 00:04:25 -0600

Seen: 323 times

Last updated: Jun 30 '20