No version for distro humble showing rolling. Known supported distros are highlighted in the buttons above.
Package symbol

ros2_fmt_logger package from ros2_fmt_logger repo

ros2_fmt_logger

ROS Distro
rolling

Package Summary

Version 1.0.0
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/nobleo/ros2_fmt_logger.git
VCS Type git
VCS Version main
Last Updated 2025-10-08
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

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

Additional Links

Maintainers

  • Tim Clephas

Authors

  • Tim Clephas

ros2_fmt_logger

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

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)

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/ros2_fmt_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 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 for more examples.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package ros2_fmt_logger

1.0.0 (2025-10-08)

  • Initial implementation for a proper ros2 logger using fmtlib
  • Contributors: Tim Clephas

Package Dependencies

System Dependencies

Name
fmt

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_fmt_logger at Robotics Stack Exchange

No version for distro jazzy showing rolling. Known supported distros are highlighted in the buttons above.
Package symbol

ros2_fmt_logger package from ros2_fmt_logger repo

ros2_fmt_logger

ROS Distro
rolling

Package Summary

Version 1.0.0
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/nobleo/ros2_fmt_logger.git
VCS Type git
VCS Version main
Last Updated 2025-10-08
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

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

Additional Links

Maintainers

  • Tim Clephas

Authors

  • Tim Clephas

ros2_fmt_logger

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

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)

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/ros2_fmt_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 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 for more examples.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package ros2_fmt_logger

1.0.0 (2025-10-08)

  • Initial implementation for a proper ros2 logger using fmtlib
  • Contributors: Tim Clephas

Package Dependencies

System Dependencies

Name
fmt

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_fmt_logger at Robotics Stack Exchange

No version for distro kilted showing rolling. Known supported distros are highlighted in the buttons above.
Package symbol

ros2_fmt_logger package from ros2_fmt_logger repo

ros2_fmt_logger

ROS Distro
rolling

Package Summary

Version 1.0.0
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/nobleo/ros2_fmt_logger.git
VCS Type git
VCS Version main
Last Updated 2025-10-08
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

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

Additional Links

Maintainers

  • Tim Clephas

Authors

  • Tim Clephas

ros2_fmt_logger

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

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)

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/ros2_fmt_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 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 for more examples.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package ros2_fmt_logger

1.0.0 (2025-10-08)

  • Initial implementation for a proper ros2 logger using fmtlib
  • Contributors: Tim Clephas

Package Dependencies

System Dependencies

Name
fmt

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_fmt_logger at Robotics Stack Exchange

Package symbol

ros2_fmt_logger package from ros2_fmt_logger repo

ros2_fmt_logger

ROS Distro
rolling

Package Summary

Version 1.0.0
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/nobleo/ros2_fmt_logger.git
VCS Type git
VCS Version main
Last Updated 2025-10-08
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

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

Additional Links

Maintainers

  • Tim Clephas

Authors

  • Tim Clephas

ros2_fmt_logger

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

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)

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/ros2_fmt_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 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 for more examples.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package ros2_fmt_logger

1.0.0 (2025-10-08)

  • Initial implementation for a proper ros2 logger using fmtlib
  • Contributors: Tim Clephas

Package Dependencies

System Dependencies

Name
fmt

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_fmt_logger at Robotics Stack Exchange

No version for distro ardent showing rolling. Known supported distros are highlighted in the buttons above.
Package symbol

ros2_fmt_logger package from ros2_fmt_logger repo

ros2_fmt_logger

ROS Distro
rolling

Package Summary

Version 1.0.0
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/nobleo/ros2_fmt_logger.git
VCS Type git
VCS Version main
Last Updated 2025-10-08
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

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

Additional Links

Maintainers

  • Tim Clephas

Authors

  • Tim Clephas

ros2_fmt_logger

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

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)

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/ros2_fmt_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 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 for more examples.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package ros2_fmt_logger

1.0.0 (2025-10-08)

  • Initial implementation for a proper ros2 logger using fmtlib
  • Contributors: Tim Clephas

Package Dependencies

System Dependencies

Name
fmt

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_fmt_logger at Robotics Stack Exchange

No version for distro bouncy showing rolling. Known supported distros are highlighted in the buttons above.
Package symbol

ros2_fmt_logger package from ros2_fmt_logger repo

ros2_fmt_logger

ROS Distro
rolling

Package Summary

Version 1.0.0
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/nobleo/ros2_fmt_logger.git
VCS Type git
VCS Version main
Last Updated 2025-10-08
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

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

Additional Links

Maintainers

  • Tim Clephas

Authors

  • Tim Clephas

ros2_fmt_logger

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

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)

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/ros2_fmt_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 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 for more examples.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package ros2_fmt_logger

1.0.0 (2025-10-08)

  • Initial implementation for a proper ros2 logger using fmtlib
  • Contributors: Tim Clephas

Package Dependencies

System Dependencies

Name
fmt

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_fmt_logger at Robotics Stack Exchange

No version for distro crystal showing rolling. Known supported distros are highlighted in the buttons above.
Package symbol

ros2_fmt_logger package from ros2_fmt_logger repo

ros2_fmt_logger

ROS Distro
rolling

Package Summary

Version 1.0.0
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/nobleo/ros2_fmt_logger.git
VCS Type git
VCS Version main
Last Updated 2025-10-08
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

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

Additional Links

Maintainers

  • Tim Clephas

Authors

  • Tim Clephas

ros2_fmt_logger

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

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)

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/ros2_fmt_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 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 for more examples.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package ros2_fmt_logger

1.0.0 (2025-10-08)

  • Initial implementation for a proper ros2 logger using fmtlib
  • Contributors: Tim Clephas

Package Dependencies

System Dependencies

Name
fmt

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_fmt_logger at Robotics Stack Exchange

No version for distro eloquent showing rolling. Known supported distros are highlighted in the buttons above.
Package symbol

ros2_fmt_logger package from ros2_fmt_logger repo

ros2_fmt_logger

ROS Distro
rolling

Package Summary

Version 1.0.0
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/nobleo/ros2_fmt_logger.git
VCS Type git
VCS Version main
Last Updated 2025-10-08
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

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

Additional Links

Maintainers

  • Tim Clephas

Authors

  • Tim Clephas

ros2_fmt_logger

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

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)

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/ros2_fmt_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 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 for more examples.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package ros2_fmt_logger

1.0.0 (2025-10-08)

  • Initial implementation for a proper ros2 logger using fmtlib
  • Contributors: Tim Clephas

Package Dependencies

System Dependencies

Name
fmt

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_fmt_logger at Robotics Stack Exchange

No version for distro dashing showing rolling. Known supported distros are highlighted in the buttons above.
Package symbol

ros2_fmt_logger package from ros2_fmt_logger repo

ros2_fmt_logger

ROS Distro
rolling

Package Summary

Version 1.0.0
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/nobleo/ros2_fmt_logger.git
VCS Type git
VCS Version main
Last Updated 2025-10-08
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

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

Additional Links

Maintainers

  • Tim Clephas

Authors

  • Tim Clephas

ros2_fmt_logger

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

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)

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/ros2_fmt_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 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 for more examples.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package ros2_fmt_logger

1.0.0 (2025-10-08)

  • Initial implementation for a proper ros2 logger using fmtlib
  • Contributors: Tim Clephas

Package Dependencies

System Dependencies

Name
fmt

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_fmt_logger at Robotics Stack Exchange

No version for distro galactic showing rolling. Known supported distros are highlighted in the buttons above.
Package symbol

ros2_fmt_logger package from ros2_fmt_logger repo

ros2_fmt_logger

ROS Distro
rolling

Package Summary

Version 1.0.0
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/nobleo/ros2_fmt_logger.git
VCS Type git
VCS Version main
Last Updated 2025-10-08
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

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

Additional Links

Maintainers

  • Tim Clephas

Authors

  • Tim Clephas

ros2_fmt_logger

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

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)

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/ros2_fmt_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 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 for more examples.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package ros2_fmt_logger

1.0.0 (2025-10-08)

  • Initial implementation for a proper ros2 logger using fmtlib
  • Contributors: Tim Clephas

Package Dependencies

System Dependencies

Name
fmt

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_fmt_logger at Robotics Stack Exchange

No version for distro foxy showing rolling. Known supported distros are highlighted in the buttons above.
Package symbol

ros2_fmt_logger package from ros2_fmt_logger repo

ros2_fmt_logger

ROS Distro
rolling

Package Summary

Version 1.0.0
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/nobleo/ros2_fmt_logger.git
VCS Type git
VCS Version main
Last Updated 2025-10-08
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

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

Additional Links

Maintainers

  • Tim Clephas

Authors

  • Tim Clephas

ros2_fmt_logger

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

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)

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/ros2_fmt_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 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 for more examples.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package ros2_fmt_logger

1.0.0 (2025-10-08)

  • Initial implementation for a proper ros2 logger using fmtlib
  • Contributors: Tim Clephas

Package Dependencies

System Dependencies

Name
fmt

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_fmt_logger at Robotics Stack Exchange

No version for distro iron showing rolling. Known supported distros are highlighted in the buttons above.
Package symbol

ros2_fmt_logger package from ros2_fmt_logger repo

ros2_fmt_logger

ROS Distro
rolling

Package Summary

Version 1.0.0
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/nobleo/ros2_fmt_logger.git
VCS Type git
VCS Version main
Last Updated 2025-10-08
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

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

Additional Links

Maintainers

  • Tim Clephas

Authors

  • Tim Clephas

ros2_fmt_logger

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

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)

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/ros2_fmt_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 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 for more examples.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package ros2_fmt_logger

1.0.0 (2025-10-08)

  • Initial implementation for a proper ros2 logger using fmtlib
  • Contributors: Tim Clephas

Package Dependencies

System Dependencies

Name
fmt

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_fmt_logger at Robotics Stack Exchange

No version for distro lunar showing rolling. Known supported distros are highlighted in the buttons above.
Package symbol

ros2_fmt_logger package from ros2_fmt_logger repo

ros2_fmt_logger

ROS Distro
rolling

Package Summary

Version 1.0.0
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/nobleo/ros2_fmt_logger.git
VCS Type git
VCS Version main
Last Updated 2025-10-08
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

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

Additional Links

Maintainers

  • Tim Clephas

Authors

  • Tim Clephas

ros2_fmt_logger

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

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)

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/ros2_fmt_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 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 for more examples.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package ros2_fmt_logger

1.0.0 (2025-10-08)

  • Initial implementation for a proper ros2 logger using fmtlib
  • Contributors: Tim Clephas

Package Dependencies

System Dependencies

Name
fmt

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_fmt_logger at Robotics Stack Exchange

No version for distro jade showing rolling. Known supported distros are highlighted in the buttons above.
Package symbol

ros2_fmt_logger package from ros2_fmt_logger repo

ros2_fmt_logger

ROS Distro
rolling

Package Summary

Version 1.0.0
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/nobleo/ros2_fmt_logger.git
VCS Type git
VCS Version main
Last Updated 2025-10-08
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

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

Additional Links

Maintainers

  • Tim Clephas

Authors

  • Tim Clephas

ros2_fmt_logger

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

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)

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/ros2_fmt_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 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 for more examples.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package ros2_fmt_logger

1.0.0 (2025-10-08)

  • Initial implementation for a proper ros2 logger using fmtlib
  • Contributors: Tim Clephas

Package Dependencies

System Dependencies

Name
fmt

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_fmt_logger at Robotics Stack Exchange

No version for distro indigo showing rolling. Known supported distros are highlighted in the buttons above.
Package symbol

ros2_fmt_logger package from ros2_fmt_logger repo

ros2_fmt_logger

ROS Distro
rolling

Package Summary

Version 1.0.0
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/nobleo/ros2_fmt_logger.git
VCS Type git
VCS Version main
Last Updated 2025-10-08
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

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

Additional Links

Maintainers

  • Tim Clephas

Authors

  • Tim Clephas

ros2_fmt_logger

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

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)

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/ros2_fmt_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 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 for more examples.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package ros2_fmt_logger

1.0.0 (2025-10-08)

  • Initial implementation for a proper ros2 logger using fmtlib
  • Contributors: Tim Clephas

Package Dependencies

System Dependencies

Name
fmt

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_fmt_logger at Robotics Stack Exchange

No version for distro hydro showing rolling. Known supported distros are highlighted in the buttons above.
Package symbol

ros2_fmt_logger package from ros2_fmt_logger repo

ros2_fmt_logger

ROS Distro
rolling

Package Summary

Version 1.0.0
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/nobleo/ros2_fmt_logger.git
VCS Type git
VCS Version main
Last Updated 2025-10-08
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

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

Additional Links

Maintainers

  • Tim Clephas

Authors

  • Tim Clephas

ros2_fmt_logger

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

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)

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/ros2_fmt_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 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 for more examples.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package ros2_fmt_logger

1.0.0 (2025-10-08)

  • Initial implementation for a proper ros2 logger using fmtlib
  • Contributors: Tim Clephas

Package Dependencies

System Dependencies

Name
fmt

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_fmt_logger at Robotics Stack Exchange

No version for distro kinetic showing rolling. Known supported distros are highlighted in the buttons above.
Package symbol

ros2_fmt_logger package from ros2_fmt_logger repo

ros2_fmt_logger

ROS Distro
rolling

Package Summary

Version 1.0.0
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/nobleo/ros2_fmt_logger.git
VCS Type git
VCS Version main
Last Updated 2025-10-08
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

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

Additional Links

Maintainers

  • Tim Clephas

Authors

  • Tim Clephas

ros2_fmt_logger

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

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)

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/ros2_fmt_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 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 for more examples.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package ros2_fmt_logger

1.0.0 (2025-10-08)

  • Initial implementation for a proper ros2 logger using fmtlib
  • Contributors: Tim Clephas

Package Dependencies

System Dependencies

Name
fmt

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_fmt_logger at Robotics Stack Exchange

No version for distro melodic showing rolling. Known supported distros are highlighted in the buttons above.
Package symbol

ros2_fmt_logger package from ros2_fmt_logger repo

ros2_fmt_logger

ROS Distro
rolling

Package Summary

Version 1.0.0
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/nobleo/ros2_fmt_logger.git
VCS Type git
VCS Version main
Last Updated 2025-10-08
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

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

Additional Links

Maintainers

  • Tim Clephas

Authors

  • Tim Clephas

ros2_fmt_logger

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

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)

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/ros2_fmt_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 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 for more examples.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package ros2_fmt_logger

1.0.0 (2025-10-08)

  • Initial implementation for a proper ros2 logger using fmtlib
  • Contributors: Tim Clephas

Package Dependencies

System Dependencies

Name
fmt

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_fmt_logger at Robotics Stack Exchange

No version for distro noetic showing rolling. Known supported distros are highlighted in the buttons above.
Package symbol

ros2_fmt_logger package from ros2_fmt_logger repo

ros2_fmt_logger

ROS Distro
rolling

Package Summary

Version 1.0.0
License Apache-2.0
Build type AMENT_CMAKE
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/nobleo/ros2_fmt_logger.git
VCS Type git
VCS Version main
Last Updated 2025-10-08
Dev Status DEVELOPED
Released UNRELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

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

Additional Links

Maintainers

  • Tim Clephas

Authors

  • Tim Clephas

ros2_fmt_logger

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

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)

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/ros2_fmt_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 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 for more examples.

File truncated at 100 lines see the full file

CHANGELOG

Changelog for package ros2_fmt_logger

1.0.0 (2025-10-08)

  • Initial implementation for a proper ros2 logger using fmtlib
  • Contributors: Tim Clephas

Package Dependencies

System Dependencies

Name
fmt

Dependant Packages

No known dependants.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged ros2_fmt_logger at Robotics Stack Exchange