0
$\begingroup$

Rosanswers logo

Is it possible to change the logger, spdlog to log4cxx, without having to rebuild individual ros packages?


Originally posted by MHx on ROS Answers with karma: 45 on 2020-11-25

Post score: 2

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Unfortunately you'll need to rebuild rcl. rcl picks the logger to use at compile time, which by default is rcl_logging_spdlog.

Add rcl_logging_log4cxx and rcl to your workspace, then choose the logging implementation by setting the environment variable RCL_LOGGING_IMPLEMENTATION.

export RCL_LOGGING_IMPLEMENTATION=rcl_logging_log4cxx
colcon build --cmake-clean-cache --packages-select rcl_logging_log4cxx rcl

There may be more relevant info in this thread: https://discourse.ros.org/t/ros2-logging/6469/24


Originally posted by sloretz with karma: 3061 on 2020-12-18

This answer was ACCEPTED on the original site

Post score: 2

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.