Ask Your Question
0

Global logger for logging without a node

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

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
1

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

Rufus gravatar image

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

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...)

export RCUTILS_CONSOLE_STDOUT_LINE_BUFFERED=1
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

2 followers

Stats

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

Seen: 20 times

Last updated: Jun 30