Ask Your Question
1

Logger conflicts with my own logger

asked 2018-05-29 15:07:51 -0500

jaduol391 gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-06-03 03:08:41 -0500

antop gravatar image

updated 2018-06-03 03:18:17 -0500

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

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

Stats

Asked: 2018-05-29 15:07:51 -0500

Seen: 114 times

Last updated: Jun 03 '18