How do I stop roscpp from logging?
roscpp
writes files under ${ROS_LOG_DIR:-${ROS_HOME:-${HOME}/.ros}/log}
. Assuming an environment where there is no disk space and/or no mounted, writable volume, what can I do to stop roscpp
from writing logs?
Here's some things I've tried that don't work:
export HOME=/nonexistent
export ROS_HOME=/dev/null
export ROS_LOG_DIR=/dev/null
export ROSCONSOLE_CONFIG_FILE=/tmp/rosconsole.config && echo "log4j.threshold=OFF" >$ROSCONSOLE_CONFIG_FILE
Here's something that does work, but requires nullfs
:
nullfs /mnt/ros-log-dir && export ROS_LOG_DIR=/mnt/ros-log-dir
Asked by rubicks on 2019-10-15 16:32:12 UTC
Answers
I've not verified whether this works, but according to wiki/rosconsole - Disable all logging:
7.1 With a configuration file
Create a custom rosconsole configuration file with the following content and use it as described above:
log4j.threshold=OFF
There have been users reporting difficulty using it though: #q292112.
It's also discussed in ros/ros_comm#139.
I seem to remember some files will still be created, but I'm not sure about that.
Edit: I believe ros/ros_comm#1425 is meant to fix that. Documented here: wiki/rosout - rosout.log:
rosout
node by default logs all messages intorosout.log
in the ROS log directory.New in Melodic This can be disabled by setting environment variable
ROSOUT_DISABLE_FILE_LOGGING
toTrue
when launching roscore.
Asked by gvdhoorn on 2019-10-16 01:49:39 UTC
Comments
I can confirm that, on my host with kinetic installed, the log4j.threshold=OFF
within ${ROSCONSOLE_CONFIG_FILE}
(which has also been exported) has no effect.
Asked by rubicks on 2019-10-16 17:17:55 UTC
Comments