Skip to content

Software

ros2_fmt_logger

By Nobleo Technology, from github.com/nobleo/ros2_fmt_logger (opens in a new tab)

  • Middleware
  • Library
  • Apache-2.0

A ROS 2 C++ logging library that adds fmt-style formatting as a replacement for the RCLCPP logging macros. It can be used alongside existing macro-based log statements.

Facts

GitHub stars
44read on 22 Nov 2026
Last update
24 Aug 2026Newest commit on main
Maintenance
Maintaineda commit in the last 12 months
Difficulty
Beginner

Checked on GitHub on 22 Nov 2026.

Licenses

Code
Apache-2.0 (opens in a new tab)

Read by Robotheca from LICENSE (opens in a new tab) (Apache-2.0) at commit f6049a0 (opens in a new tab), on 16 Oct 2026.

Commercial use
Yes

At a glance

What it is
  • Logs with function calls and fmt format strings instead of printf-style macros.
  • Adds .on_change() style logging that emits only when a value changes or exceeds a threshold.
  • Supports chrono-based throttling, for example logging at most once per given interval.
  • Offers once-only logging for messages that should appear a single time.
  • An optional header provides fmt formatters for rclcpp Duration, Time and Rate types.
  • Stays backwards compatible with the RCLCPP macros, so existing projects can adopt it gradually.

Robotheca's summary of the project's documents, not the creator's words.

Robots on Robotheca
No robot on Robotheca uses it yet.
Licence
Apache-2.0. Commercial use: Yes. Where it was read
Install
In the creator's words: The project's README (opens in a new tab)
Maintenance
Maintained, last commit on 24 Aug 2026.

Use it

How to install it, in the creator's words: The project's README (opens in a new tab)

Robotheca doesn't review code. Read it before running it.

Files and versions

Facts read at commit f6049a0

Robotheca never hosts the code: each link goes to the creator's own page.

The README

The creator's own README, copied as written: README.md by Nobleo Technology, at commit f6049a0, under Apache-2.0 (opens in a new tab). The original on GitHub (opens in a new tab).

Read the README here

ros2_fmt_logger

A modern, ROS 2 logging library that provides fmt-style formatting as a replacement for RCLCPP logging macros.

(opens in a new tab) (opens in a new tab) (opens in a new tab)

Image: Build Status (opens in a new tab) (opens in a new tab) Image: Build Status (opens in a new tab) (opens in a new tab) Image: Build Status (opens in a new tab) (opens in a new tab) Image: Build Status (opens in a new tab) (opens in a new tab) Image: Build Status (opens in a new tab) (opens in a new tab)

Features
  • Function calls instead of macros: logger.info("Hello, {}!", name) instead of RCLCPP_INFO(logger, "Hello, %s", name.c_str())
  • Additional .on_change() method for logging changes in values
  • Chrono syntax for throttling: logger.warn_throttle(1s, "Warning: {}", value)
  • Backwards compatible with the macros, so easy to start using in existing projects without a full rewrite of the current log statements
Examples
Once-only logging
logger.info_once("This message will only appear once, no matter how many times called");
Throttled logging
using std::chrono_literals::operator""s;
logger.warn_throttle(1s, "This warning appears at most once per second: {}", value);
Change-based logging
// Log only when the value changes
logger.info_on_change(sensor_value, "Sensor reading changed to: {}", sensor_value);

// Log only when change exceeds threshold
logger.error_on_change(temperature, 5.0, "Temperature changed significantly: {:.1f}°C", temperature);
Quick Start
Include in the package.xml
<depend>ros2_fmt_logger</depend>
Configure c++20 and find_package
find_package(ros2_fmt_logger REQUIRED)
target_link_libraries(your_target ros2_fmt_logger::ros2_fmt_logger)
Include the header
#include <ros2_fmt_logger/logger.hpp>
Create a logger instance
// From an rclcpp::Logger
auto logger = ros2_fmt_logger::Logger(node->get_logger());

// With custom clock for throttling features
auto logger = ros2_fmt_logger::Logger(node->get_logger(), node->get_clock());
3. Use modern logging syntax
// Instead of: RCLCPP_INFO(logger, "Processing item %d with value %.2f", id, value);
logger.info("Processing item {} with value {:.2f}", id, value);

// Instead of: RCLCPP_ERROR(logger, "Failed to connect to %s:%d", host.c_str(), port);
logger.error("Failed to connect to {}:{}", host, port);
Format String Syntax

Uses the powerful fmt library (opens in a new tab) format syntax:

// Basic formatting
logger.info("Hello, {}!", name);

// Positional arguments
logger.info("Processing {1} of {0} items", total, current);

// Format specifiers
logger.info("Progress: {:.1}%", progress);  // Percentage with 1 decimal
logger.info("Value: {:08.2f}", value);      // Zero-padded floating point
logger.info("Hex: {:#x}", number);          // Hexadecimal with 0x prefix

// Container formatting (requires fmt/ranges.h)
logger.info("Values: {}", std::vector{1, 2, 3, 4});

See demo_ros2_fmt_logger.cpp (opens in a new tab) for more examples.

ROS Type Formatting

The optional rclcpp_formatters.hpp header provides fmt formatters for common ROS types:

#include <ros2_fmt_logger/logger.hpp>
#include <ros2_fmt_logger/rclcpp_formatters.hpp>  // IWYU pragma: keep
Supported types
TypeExample output
rclcpp::Duration0.8s, 5s
rclcpp::Time2026-06-03 08:59:17
rclcpp::(Wall)Rate10Hz, 0.5Hz
rclcpp::Duration duration{800ms};
logger.info("Duration: {}", duration);  // "Duration: 0.8s"

rclcpp::Time time = node->get_clock()->now();
// Default human-readable format or custom fmt chrono format specifiers:
logger.info("Default: {}", time);        // "Default: 2026-06-03 08:59:17"
logger.info("Date: {:%Y-%m-%d}", time);  // "Date: 2026-06-03"

See chrono-format-specifications (opens in a new tab) for the supported format specifiers for rclcpp::Time and rclcpp::Duration.

Alternatives
Credits

Image: Nobleo Logo (opens in a new tab)

This is a package developed by Nobleo Autonomous Solutions B.V.

Looking for paid support options? Contact us at nobleo-technology.nl (opens in a new tab).

Robotheca lists software as a reference: nothing is hosted or run here, and every fact links to where it was read.