ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

How can I disable smach state transition log messages?

asked 2012-09-13 23:09:06 -0600

updated 2012-09-13 23:15:22 -0600

Every time that smach performs a transition to a new state, it issues an Info log message indicating the time and the transition made. Is there a way of disabling those messages?.

I have read the following related questions, but found no answer to this problem:

http://answers.ros.org/question/10299/rospy-logging/

http://answers.ros.org/question/10269/rospy-logging-configuration/

http://answers.ros.org/question/9802/change-python-node-log-level-while-running/

edit retag flag offensive close merge delete

Comments

Does rxloggerlevel help? Maybe they are in a named logger.

dornhege gravatar image dornhege  ( 2012-09-14 00:02:50 -0600 )edit

I don't think rxloggerlevel works for Python logging.

joq gravatar image joq  ( 2012-09-14 05:22:12 -0600 )edit
Ricardo Tellez gravatar image Ricardo Tellez  ( 2012-09-29 00:34:56 -0600 )edit

I updated the thread http://answers.ros.org/question/10299/rospy-logging/?answer=103161#post-id-103161. In nutshell; rospy logger can/should be tracked now.

130s gravatar image 130s  ( 2013-11-20 01:29:34 -0600 )edit

4 Answers

Sort by ยป oldest newest most voted
3

answered 2012-09-14 08:13:00 -0600

jbohren gravatar image

updated 2012-09-14 08:15:11 -0600

Two things.

First, please create a ticket for this on the SMACH trac here: https://kforge.ros.org/smach/trac/newticket

Second, if you want to just change all of the SMACH loginfo calls to logdebug in an overlay, you can just modify line 44 of executive_smach/smach_ros/src/__init__.py and replace "rospy.loginfo" with "rospy.logdebug".

As @joq points out, there's no easy way to switch python logger levels at runtime. Because of this, we made it so that this information is reported at the info level because more often than not we wanted to see the information, but not all of the minute "debug" logging output that you would see in Python.

edit flag offensive delete link more
2

answered 2012-09-14 05:28:25 -0600

joq gravatar image

As those Q&A entries say, there is currently no clean solution to your problem for Python logging.

It's ugly, but I suppose you could check out a SMACH source overlay and comment out the offending log messages in that local copy.

You can also open a defect ticket, to suppress those messages in a future release. That seems valid to me, although the SMACH developers might disagree.

edit flag offensive delete link more

Comments

I think that these really should be DEBUG messages instead of INFO.

AHornung gravatar image AHornung  ( 2012-09-14 06:39:27 -0600 )edit

I agree, hence the defect ticket suggestion.

joq gravatar image joq  ( 2012-09-14 07:17:27 -0600 )edit

I think the SMACH developers agree that it should at least be an option.

jbohren gravatar image jbohren  ( 2012-09-14 08:09:46 -0600 )edit
1

answered 2013-11-20 01:19:37 -0600

Siegfried Gevatter gravatar image

updated 2013-11-20 01:20:11 -0600

I haven't tried it, but with a version of ROS newer than August 2012 it should be possible to do something like the following:

import logging
class Filter(logging.Filter):
    def filter(self, record):
        return 'State machine transitioning' not in record.msg
logging.getLogger('rosout').addFilter(MyFilter())
edit flag offensive delete link more
0

answered 2023-03-15 11:03:01 -0600

fclad gravatar image
        smach.set_loggers(rospy.logdebug, rospy.logwarn, rospy.logdebug, rospy.logerr)

provides a way smarter log level for smach.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2012-09-13 23:09:06 -0600

Seen: 2,904 times

Last updated: Nov 20 '13