From ba38a8a434438956bb3dee9e099b37032c7b5d43 Mon Sep 17 00:00:00 2001 From: William Woodall Date: Fri, 18 Nov 2022 15:43:17 -0800 Subject: [PATCH] release note about change to log file flushing (#3193) * release note about change to log file flushing https://github.com/ros2/rcl_logging/pull/95 * mention the volatility of the env var * Apply suggestions from code review Co-authored-by: Ivan Santiago Paunovic Co-authored-by: Audrow Nash * emphasize note about experimental status also link to issue about logging config file plans Co-authored-by: Ivan Santiago Paunovic Co-authored-by: Audrow Nash (cherry picked from commit 2002bbdfa175c79bca0928856ec5c1450faf568f) --- source/Releases/Release-Iron-Irwini.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/source/Releases/Release-Iron-Irwini.rst b/source/Releases/Release-Iron-Irwini.rst index 39d923cc4d3..397a5619c86 100644 --- a/source/Releases/Release-Iron-Irwini.rst +++ b/source/Releases/Release-Iron-Irwini.rst @@ -68,6 +68,23 @@ Classes that were changed: The old class names are still there, but will be deprecated. +Change to the default console logging file flushing behavior +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This specifically applies to the default ``spdlog`` based logging backend in ROS 2, implemented in ``rcl_logging_spdlog``. +Log file flushing was changed to flush every time an "error" log message is used, e.g. each `RCLCPP_ERROR()` call, and also periodically every five seconds. + +Previously, ``spdlog`` was used without configuring anything other than creating the sink for logging to a file. + +We tested the change and did not find that the CPU overhead was significant, even on machines with slow disks (e.g. sd cards). +However, if this change is causing you problems, you can get the old behavior by setting the ``RCL_LOGGING_SPDLOG_EXPERIMENTAL_OLD_FLUSHING_BEHAVIOR=1`` environment variable. + +Later we would like to have support for a full configuration file (see: https://github.com/ros2/rcl_logging/issues/92), giving you more flexibility in how the logging is done, but that is work that is only planned right now. + + Therefore, **this environment variable should be considered experimental and subject to removal without deprecation in the future**, when we add config file support for the ``rcl_logging_spdlog`` logging backend. + +See this pull request for more details about the change: https://github.com/ros2/rcl_logging/pull/95 + Known Issues ------------