[ros-users] Log Handler question for rospy

Mike Purvis mpurvis at clearpathrobotics.com
Thu Sep 16 14:20:25 UTC 2010


Hey,

I have a question about logging and rospy. We've been using stdout, but with
doing more remote node launches, it's advantageous to use the rospy.log*
functions which put Log messages on the /rosout topic.

One of our main nodes is a light ROS wrapper over a more general-purpose
serial Python API to our hardware. This Python API already produces
extensive debug and logging information using the standard python
logging.getLogger facility. Is there an easy way to expose this information
on rosout? I took a quick look
here<http://www.ros.org/doc/api/rospy/html/rospy.core-pysrc.html>and
didn't see anything--- has anyone written a log handler that captures
standard python log messages and sends them as Ros Log messages?

What I'm envisioning is something like this:

logging.getLogger('clearpath.horizon').addHandler(RosLogHandler())

Does this exist? If not, is there a reason not to do such a thing?

Thanks,

Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/ros-users/attachments/20100916/61b7f0fe/attachment-0002.html>


More information about the ros-users mailing list