0
$\begingroup$

Rosanswers logo

I just did some test, and seems that rospy logging ignores exc_info=True which is supported by Python loggers.

So when exc_info evaluates True, python logger also logs the exception info. But I cannot make rospy.logerr() work with this.

Did I miss anything?


Originally posted by yong on ROS Answers with karma: 28 on 2018-09-20

Post score: 0


Original comments

Comment by gvdhoorn on 2018-09-20:
What is this a duplicate of?

Comment by yong on 2018-09-20:
I forgot to choose the option. It is not a duplicate. It is that the rospy log methods only take *args, so it looks obvious it doesn't forward **kwargs to python logging. I am going to delete this question

Comment by gvdhoorn on 2018-09-20:
I've re-opened it for you.

If you'e figured something out, please post an answer and accept your own answer.

Comment by yong on 2018-09-20:
I cannot accept my own answer yet. It requires 10+ points.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

So I didn't notice that rospy log methods only take *args. That makes it obvious that they do not support python logger's **kwargs (exc_info and extra).

PS:

  1. **kwargs is included in the prototypes of those Python methods. It is just the wiki page that needs to be updated.
  2. The support for Python logging's **kwargs (exc_info and extra) will be fixed by: https://github.com/ros/ros_comm/pull/1289

Originally posted by yong with karma: 28 on 2018-09-20

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by gvdhoorn on 2018-09-20:
Is this actually true? I see both kwargs as well as args here.

Comment by yong on 2018-09-20:
But not in this wiki page. http://wiki.ros.org/rospy/Overview/Logging So this is a valid question then. It is a little bit confusing.

Comment by gvdhoorn on 2018-09-20:
The wiki page just doesn't seem to have been updated after ros/ros_comm#948 was merged.

Perhaps you can update the wiki or post a comment on the PR asking why the wiki wasn't updated.

Comment by yong on 2018-09-20:
Thanks. I will post a comment there, and also point out it probably broke the python logger's kwargs handling

Comment by ahendrix on 2018-09-21:
Actually... this is probably my fault for not updating the documentation back in 2012: https://github.com/ros/ros_comm/pull/6

$\endgroup$

Your Answer

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