ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Where do ROSCPP_LOG_DEBUG messages go?

asked 2016-08-24 18:19:28 -0500

sunking gravatar image

hello, can anyone tell me where debug messages using the ROSCPP_LOG_DEBUG macro go to? (its used quite extensively in the roscpp sources). I built roscpp from source and enabled debug build. I looked in ~/.ros/log but saw nothing of interest there

More generally, the info page at says that "The base versions [of eg ROS_DEBUG] output to a logger named "ros.your_package_name"" but I'm not sure what this means.


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2016-08-24 22:13:09 -0500

ahendrix gravatar image

Per the documentation on :

The default verbosity level is INFO, so DEBUG statements will not be seen by default.

If DEBUG is enabled, it goes to stdout and the /rosout topic. You can view the /rosout topic with rqt_console.

The docs also describe how to set the log level, to enable DEBUG:

Setting Verbosity Levels

There are three ways of setting verbosity levels on a roscpp node. The first is through a configuration file which sets the verbosity level for every node in the system, the second is at runtime through the rqt_logger_level (former rxloggerlevel) or rqt_console (former rxconsole) tools, and the third is programmatically through the rosconsole API:

I recommend starting with rqt_console because it allows you to view the log messages and all of the loggers and modify the verbosity level at run-time.

edit flag offensive delete link more


Tried rqt_console I see INFO msgs but still no DEBUG msgs. eg. this line in subscription.cpp should display every time a subscriber tries to XMLRPC connect with a publisher but it does not. ROSCPP_LOG_DEBUG("Began asynchronous xmlrpc connection to [%s:%d]", peer_host.c_str(), peer_port);

sunking gravatar image sunking  ( 2016-08-25 16:10:43 -0500 )edit

answered 2016-08-25 16:28:14 -0500

Dirk Thomas gravatar image

If you are using binaries built in release mode the debug logging macros will evaluate to nothing and essentially be removed for performance reasons.

So if you want to see the debug message on the console / rosout / rqt_console you have to make sure that you are building debug binaries (-DCMAKE_BUILD_TYPE=Debug).

edit flag offensive delete link more


Yes that is what I am doing. I am building just roscpp using ./src/catkin/bin/catkin_make_isolated --install --pkg roscpp -DCMAKE_BUILD_TYPE=Debug and then copying the generated library install_isolated/lib/ to /opt/ros/indigo/lib. But I still don't see those ROSCPP_LOG_DEBUG messages

sunking gravatar image sunking  ( 2016-08-31 16:56:48 -0500 )edit

@Dirk, do you have any response to my follow up? As I said I am building the appropriate library debug build.

sunking gravatar image sunking  ( 2016-09-04 01:54:16 -0500 )edit

Since I don't know what you are using to configure the logging level I don't have a recommendation. When I use rqt_logger_level to change the level of the ros.roscpp.roscpp_internal logger of the talker node to Debug the talker starts printing more information when a new listener connects.

Dirk Thomas gravatar image Dirk Thomas  ( 2016-09-06 13:34:15 -0500 )edit

Question Tools

1 follower


Asked: 2016-08-24 18:19:28 -0500

Seen: 1,572 times

Last updated: Aug 25 '16