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

Revision history [back]

click to hide/show revision 1
initial version

Hrm, I think it might still need some effort to completely disable everything (as jack suggested, be sure to write a ticket if you wish), but here are some things you can play around with:

Master Logging

Start with 'rosmaster --core' instead of 'roscore'. This avoids firing up rosout.

Cpp Logging

Create an empty $ROS_ROOT/rosconfig.cmake and add the empty line

set(ROS_COMPILE_FLAGS "-DROSCONSOLE_MIN_SEVERITY=5 ${ROS_COMPILE_FLAGS}")

(note ROSCONSOLE_MIN_SEVERITY_NONE = 5 as defined in rosconsole/include/ros/console.h) and then recompile everything. This should disable all your cpp loggers. There is an exception though - the roscpp_internal named logger bypasses this as it seems it uses the log4cxx logger interfaces directly. I actually can't seem to change that logger's level (also roscpp.superdebug) at all via the rosconsole.config file, but that is a separate problem.

Python Logging

If you delete ${ROS_ROOT}/config/python_logging.conf, python programs will just completely abort any logging. I don't know that this is the recommended way of doing it though ;)

So, in conclusion, looks like it might be possible, just roscpp might need a better look at so you can disable those two named internal loggers.

Hrm, I think it might still need some effort to completely disable everything (as jack suggested, be sure to write a ticket if you wish), but here are some things you can play around with:

Master LoggingNo Rosout

Start with 'rosmaster --core' instead of 'roscore'. This avoids firing up rosout.

Cpp Logging

Create an empty $ROS_ROOT/rosconfig.cmake and add the empty line

set(ROS_COMPILE_FLAGS "-DROSCONSOLE_MIN_SEVERITY=5 ${ROS_COMPILE_FLAGS}")

(note ROSCONSOLE_MIN_SEVERITY_NONE = 5 as defined in rosconsole/include/ros/console.h) and then recompile everything. This should disable all your cpp loggers. There is an exception though - the roscpp_internal named logger bypasses this as it seems it uses the log4cxx logger interfaces directly. I actually can't seem to change that logger's level (also roscpp.superdebug) at all via the rosconsole.config file, but that is a separate problem.

Python Logging

If you delete ${ROS_ROOT}/config/python_logging.conf, python programs will just completely abort any logging. I don't know that this is the recommended way of doing it though ;)

Conclusions

So, in conclusion, looks like it might be possible, possible to disable everything, just roscpp might need a better look at so you can disable those two named internal loggers.

loggers.

However, this doesn't address your initial query - i.e. how to disable file logging whilst maintaining rosout topics. That would, I suspect, require a change in the architecture of the logging system.

Possible Solutions

If you really want to be minimal, then escape the overhead of the ros logging architecture completely by disabling things as above. Write a couple of your own topics that do publishing work only publish when there's a subscriber.

If not, then like any framework, its probably easier to find ways to work with it than fight it. Use a small ramdisk reserved for logging, or if possible, while developing, have a usb port with which you can plug a pen drive into. Either point your config and log directories there or create a union filesystem.

The last alternative is to request an overhaul of rosconsole, rospy and rosout so that they don't write to file on request. This would enable debugging output locked only on the rosout topics. Which, is not exactly an unreasonable idea for read only embedded systems.