0
$\begingroup$

Rosanswers logo

When I call rospy.init_node, logging of errors using my own defined logger stops working and nothing is displayed. For example when I call an object without its arguments, I get a TypeError printed on the interpreter but after I call rospy.init_node the same object instantiation without arguments goes through without any error being printed. This then makes it difficult to debug my code.

The logger I use is derived from the Python logging module. I am using Python3 with the Python2 rospy module in the Ubuntu terminal multiplexer screen. I am using ROS Kinetic.

My question is: Does anyone know how to resolve such a problem? Can I use the rospy logger with my own?

Thanks in advance.


Originally posted by jaduol391 on ROS Answers with karma: 11 on 2018-05-29

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Same issue for me.

I have a completely working python logger, but when I wrap my python code in a ROS node, python logging is disabled.

As I have seen, this is a known issue: for unknown reasons, normal python logging is disabled after a call to rospy.init_node(). So far, the only solution seems to be to redirect the logging message in the ROS logging.

Maybe, this could be useful: Override Logging Configuration


Originally posted by antop with karma: 36 on 2018-06-03

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.