[ros-users] Log Handler question for rospy

Forside
Vedhæftede filer:
Indlæg som e-mail
+ (text/plain)
+ (text/html)
Slet denne besked
Besvar denne besked
Skribent: Mike Purvis
Dato:  
Til: ros-users
Emne: [ros-users] Log Handler question for rospy
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