ros / rosconsole

17 stars 61 forks source link

Recursive messages at debug level #30

Closed mferenduros closed 4 years ago

mferenduros commented 5 years ago

I'm not sure if this report belongs in ros_comm or here, but at debug logging-level I get a flood of "Warning: recursive print statement has occurred. Throwing out recursive print."

This seems to happen because console::print indirectly invokes ROSAppender::log, which calls param::getCached, which calls ROS_DEBUG_NAMED, which ends up back in console::print.

athish-t commented 5 years ago

+1

Kaju-Bubanja commented 5 years ago

Also affected by this. As a workaround if you have control over the source, just change your log statements to info level.

mehditlili commented 4 years ago

I am also affected by this, having multiple ROS_DEBUG, ROS_DEBUG_STREAM and ROS_DEBUG_STREAM_THROTTLE, this occurs when I run rqt_logger_level, choose my node and set the level to DEBUG. rqt_logger_level also crashes with the following error:

Traceback (most recent call last): File "/opt/ros/melodic/lib/python2.7/dist-packages/rqt_logger_level/logger_level_widget.py", line 126, in level_changed self._caller.send_logger_change_message(self.node_list.currentItem().text(), self.logger_list.currentItem().text(), self.level_list.item(row).text()) File "/opt/ros/melodic/lib/python2.7/dist-packages/rqt_logger_level/logger_level_service_caller.py", line 114, in send_logger_change_message service = rosservice.get_service_class_by_name(servicename) File "/opt/ros/melodic/lib/python2.7/dist-packages/rosservice/init.py", line 370, in get_service_class_by_name service_type = get_service_type(service_name) File "/opt/ros/melodic/lib/python2.7/dist-packages/rosservice/init.py", line 147, in get_service_type return get_service_headers(service_name, service_uri).get('type', None) File "/opt/ros/melodic/lib/python2.7/dist-packages/rosservice/init.py", line 126, in get_service_headers raise ROSServiceIOException("Unable to communicate with service [%s], address [%s]"%(service_name, service_uri)) rosservice.ROSServiceIOException: Unable to communicate with service [/scene_aggregator/set_logger_level], address [rosrpc://127.0.0.1:42385]

Using the latest ros melodic on Ubuntu 18.04

mehditlili commented 4 years ago

Just an update, might be unrelated to the question here but what was causing the crash of my node was setting its logger level to DEBUG and calling nh_.getParamCached, it seems that getParamCached is not correctly implemented.

zbynekwinkler commented 4 years ago

Setting ros.roscpp.cached_parameters=INFO workarounds this problem - that is - unless the intention was to debug cashed parameters :smile:.

dirk-thomas commented 4 years ago

Resolved by ros/ros_comm#1823.