Type safe logging

asked 2022-07-20 16:02:50 -0500

catch22 gravatar image

updated 2022-07-20 17:31:06 -0500

The ROS logging macros suffer from all the dangers of printf. Modern logging systems like spdlog, address these issues, but we're stuck with the old style va-arg style printf method.

I spent yesterday sanitizing hundreds of incorrect ros logging statements, that had mismatches between the format specifier and the data provided.

I wonder if there's been any discuss about improving this, or are there alternatives?

edit retag flag offensive close merge delete

Comments

Hi, have a look at this thread in ROS discourse, it might be useful https://discourse.ros.org/t/ros2-logg...

martimorta gravatar image martimorta  ( 2022-07-21 04:23:03 -0500 )edit

I like it!

catch22 gravatar image catch22  ( 2022-08-10 02:36:33 -0500 )edit