Ask Your Question
0

Does rospy logging support "exc_info"

asked 2018-09-20 10:26:45 -0500

yong gravatar image

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?

edit retag flag offensive close merge delete

Comments

What is this a duplicate of?

gvdhoorn gravatar image gvdhoorn  ( 2018-09-20 14:03:32 -0500 )edit

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

yong gravatar image yong  ( 2018-09-20 14:09:53 -0500 )edit

I've re-opened it for you.

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

gvdhoorn gravatar image gvdhoorn  ( 2018-09-20 14:12:04 -0500 )edit

I cannot accept my own answer yet. It requires 10+ points.

yong gravatar image yong  ( 2018-09-20 14:23:35 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-09-20 14:23:07 -0500

yong gravatar image

updated 2018-09-24 07:34:42 -0500

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/...
edit flag offensive delete link more

Comments

Is this actually true? I see both kwargs as well as argshere.

gvdhoorn gravatar image gvdhoorn  ( 2018-09-20 15:10:19 -0500 )edit

But not in this wiki page. http://wiki.ros.org/rospy/Overview/Lo... So this is a valid question then. It is a little bit confusing.

yong gravatar image yong  ( 2018-09-20 15:23:23 -0500 )edit

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.

gvdhoorn gravatar image gvdhoorn  ( 2018-09-20 15:40:10 -0500 )edit

Thanks. I will post a comment there, and also point out it probably broke the python logger's kwargs handling

yong gravatar image yong  ( 2018-09-20 15:58:46 -0500 )edit

Actually... this is probably my fault for not updating the documentation back in 2012: https://github.com/ros/ros_comm/pull/6

ahendrix gravatar image ahendrix  ( 2018-09-21 00:58:26 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-09-20 10:26:45 -0500

Seen: 141 times

Last updated: Sep 24 '18