ros / ros_comm

ROS communications-related packages, including core client libraries (roscpp, rospy, roslisp) and graph introspection tools (rostopic, rosnode, rosservice, rosparam).
http://wiki.ros.org/ros_comm
752 stars 911 forks source link

Add an environment variable to disable rosout #2252

Closed gstorer closed 1 year ago

gstorer commented 2 years ago

There are a lot of questions around asking about how to disable logging in ROS. One of the more difficult things to do is to turn off rosout. Our solution was to patch all of our ROS installs and set an environment variable to disable logging.

ROSOUT_DISABLE_FILE_LOGGING exists but rosout still runs which is unnecessary for our deployed systems.

https://github.com/ros/ros_comm/issues/139 https://answers.ros.org/question/9627/how-can-i-completely-disable-writing-logs-to-filesystem/

peci1 commented 1 year ago

I think this can be quite easily solved by crafting your own roscore.xml file. It is first searched in ROS_ETC_DIR:

https://github.com/ros/ros_comm/blob/842f0f026924323f605495da0b80493f15f0bdce/tools/roslaunch/src/roslaunch/config.py#L80

So if you want this to be configurable during runtime, just create an alternative ROS_ETC_DIR with the altered roslaunch.xml. You can then select whether you want rosout or not by just changing ROS_ETC_DIR.

gstorer commented 1 year ago

Yes, that would indeed solve our problems. I wasn't aware of the ROS_ETC_DIR variable. I will close this pull request.