rclcpp  master
C++ ROS Client Library API
Macros
logging.hpp File Reference
#include <sstream>
#include <type_traits>
#include "rclcpp/logger.hpp"
#include "rcutils/logging_macros.h"
#include "rclcpp/utilities.hpp"
Include dependency graph for logging.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define RCLCPP_LOG_MIN_SEVERITY_DEBUG   0
 
#define RCLCPP_LOG_MIN_SEVERITY_INFO   1
 
#define RCLCPP_LOG_MIN_SEVERITY_WARN   2
 
#define RCLCPP_LOG_MIN_SEVERITY_ERROR   3
 
#define RCLCPP_LOG_MIN_SEVERITY_FATAL   4
 
#define RCLCPP_LOG_MIN_SEVERITY_NONE   5
 
#define RCLCPP_FIRST_ARG(N, ...)   N
 
#define RCLCPP_ALL_BUT_FIRST_ARGS(N, ...)   __VA_ARGS__
 
#define RCLCPP_LOG_MIN_SEVERITY   RCLCPP_LOG_MIN_SEVERITY_DEBUG
 
Logging macros for severity DEBUG.
#define RCLCPP_DEBUG(logger, ...)
 
#define RCLCPP_DEBUG_ONCE(logger, ...)
 
#define RCLCPP_DEBUG_EXPRESSION(logger, expression, ...)
 
#define RCLCPP_DEBUG_FUNCTION(logger, function, ...)
 
#define RCLCPP_DEBUG_SKIPFIRST(logger, ...)
 
#define RCLCPP_DEBUG_THROTTLE(logger, clock, duration, ...)
 
#define RCLCPP_DEBUG_SKIPFIRST_THROTTLE(logger, clock, duration, ...)
 
#define RCLCPP_DEBUG_STREAM(logger, stream_arg)
 
#define RCLCPP_DEBUG_STREAM_ONCE(logger, stream_arg)
 
#define RCLCPP_DEBUG_STREAM_EXPRESSION(logger, expression, stream_arg)
 
#define RCLCPP_DEBUG_STREAM_FUNCTION(logger, function, stream_arg)
 
#define RCLCPP_DEBUG_STREAM_SKIPFIRST(logger, stream_arg)
 
#define RCLCPP_DEBUG_STREAM_THROTTLE(logger, clock, duration, stream_arg)
 
#define RCLCPP_DEBUG_STREAM_SKIPFIRST_THROTTLE(logger, clock, duration, stream_arg)
 
Logging macros for severity INFO.
#define RCLCPP_INFO(logger, ...)
 
#define RCLCPP_INFO_ONCE(logger, ...)
 
#define RCLCPP_INFO_EXPRESSION(logger, expression, ...)
 
#define RCLCPP_INFO_FUNCTION(logger, function, ...)
 
#define RCLCPP_INFO_SKIPFIRST(logger, ...)
 
#define RCLCPP_INFO_THROTTLE(logger, clock, duration, ...)
 
#define RCLCPP_INFO_SKIPFIRST_THROTTLE(logger, clock, duration, ...)
 
#define RCLCPP_INFO_STREAM(logger, stream_arg)
 
#define RCLCPP_INFO_STREAM_ONCE(logger, stream_arg)
 
#define RCLCPP_INFO_STREAM_EXPRESSION(logger, expression, stream_arg)
 
#define RCLCPP_INFO_STREAM_FUNCTION(logger, function, stream_arg)
 
#define RCLCPP_INFO_STREAM_SKIPFIRST(logger, stream_arg)
 
#define RCLCPP_INFO_STREAM_THROTTLE(logger, clock, duration, stream_arg)
 
#define RCLCPP_INFO_STREAM_SKIPFIRST_THROTTLE(logger, clock, duration, stream_arg)
 
Logging macros for severity WARN.
#define RCLCPP_WARN(logger, ...)
 
#define RCLCPP_WARN_ONCE(logger, ...)
 
#define RCLCPP_WARN_EXPRESSION(logger, expression, ...)
 
#define RCLCPP_WARN_FUNCTION(logger, function, ...)
 
#define RCLCPP_WARN_SKIPFIRST(logger, ...)
 
#define RCLCPP_WARN_THROTTLE(logger, clock, duration, ...)
 
#define RCLCPP_WARN_SKIPFIRST_THROTTLE(logger, clock, duration, ...)
 
#define RCLCPP_WARN_STREAM(logger, stream_arg)
 
#define RCLCPP_WARN_STREAM_ONCE(logger, stream_arg)
 
#define RCLCPP_WARN_STREAM_EXPRESSION(logger, expression, stream_arg)
 
#define RCLCPP_WARN_STREAM_FUNCTION(logger, function, stream_arg)
 
#define RCLCPP_WARN_STREAM_SKIPFIRST(logger, stream_arg)
 
#define RCLCPP_WARN_STREAM_THROTTLE(logger, clock, duration, stream_arg)
 
#define RCLCPP_WARN_STREAM_SKIPFIRST_THROTTLE(logger, clock, duration, stream_arg)
 
Logging macros for severity ERROR.
#define RCLCPP_ERROR(logger, ...)
 
#define RCLCPP_ERROR_ONCE(logger, ...)
 
#define RCLCPP_ERROR_EXPRESSION(logger, expression, ...)
 
#define RCLCPP_ERROR_FUNCTION(logger, function, ...)
 
#define RCLCPP_ERROR_SKIPFIRST(logger, ...)
 
#define RCLCPP_ERROR_THROTTLE(logger, clock, duration, ...)
 
#define RCLCPP_ERROR_SKIPFIRST_THROTTLE(logger, clock, duration, ...)
 
#define RCLCPP_ERROR_STREAM(logger, stream_arg)
 
#define RCLCPP_ERROR_STREAM_ONCE(logger, stream_arg)
 
#define RCLCPP_ERROR_STREAM_EXPRESSION(logger, expression, stream_arg)
 
#define RCLCPP_ERROR_STREAM_FUNCTION(logger, function, stream_arg)
 
#define RCLCPP_ERROR_STREAM_SKIPFIRST(logger, stream_arg)
 
#define RCLCPP_ERROR_STREAM_THROTTLE(logger, clock, duration, stream_arg)
 
#define RCLCPP_ERROR_STREAM_SKIPFIRST_THROTTLE(logger, clock, duration, stream_arg)
 
Logging macros for severity FATAL.
#define RCLCPP_FATAL(logger, ...)
 
#define RCLCPP_FATAL_ONCE(logger, ...)
 
#define RCLCPP_FATAL_EXPRESSION(logger, expression, ...)
 
#define RCLCPP_FATAL_FUNCTION(logger, function, ...)
 
#define RCLCPP_FATAL_SKIPFIRST(logger, ...)
 
#define RCLCPP_FATAL_THROTTLE(logger, clock, duration, ...)
 
#define RCLCPP_FATAL_SKIPFIRST_THROTTLE(logger, clock, duration, ...)
 
#define RCLCPP_FATAL_STREAM(logger, stream_arg)
 
#define RCLCPP_FATAL_STREAM_ONCE(logger, stream_arg)
 
#define RCLCPP_FATAL_STREAM_EXPRESSION(logger, expression, stream_arg)
 
#define RCLCPP_FATAL_STREAM_FUNCTION(logger, function, stream_arg)
 
#define RCLCPP_FATAL_STREAM_SKIPFIRST(logger, stream_arg)
 
#define RCLCPP_FATAL_STREAM_THROTTLE(logger, clock, duration, stream_arg)
 
#define RCLCPP_FATAL_STREAM_SKIPFIRST_THROTTLE(logger, clock, duration, stream_arg)
 

Macro Definition Documentation

◆ RCLCPP_LOG_MIN_SEVERITY_DEBUG

#define RCLCPP_LOG_MIN_SEVERITY_DEBUG   0

◆ RCLCPP_LOG_MIN_SEVERITY_INFO

#define RCLCPP_LOG_MIN_SEVERITY_INFO   1

◆ RCLCPP_LOG_MIN_SEVERITY_WARN

#define RCLCPP_LOG_MIN_SEVERITY_WARN   2

◆ RCLCPP_LOG_MIN_SEVERITY_ERROR

#define RCLCPP_LOG_MIN_SEVERITY_ERROR   3

◆ RCLCPP_LOG_MIN_SEVERITY_FATAL

#define RCLCPP_LOG_MIN_SEVERITY_FATAL   4

◆ RCLCPP_LOG_MIN_SEVERITY_NONE

#define RCLCPP_LOG_MIN_SEVERITY_NONE   5

◆ RCLCPP_FIRST_ARG

#define RCLCPP_FIRST_ARG (   N,
  ... 
)    N

◆ RCLCPP_ALL_BUT_FIRST_ARGS

#define RCLCPP_ALL_BUT_FIRST_ARGS (   N,
  ... 
)    __VA_ARGS__

◆ RCLCPP_LOG_MIN_SEVERITY

#define RCLCPP_LOG_MIN_SEVERITY   RCLCPP_LOG_MIN_SEVERITY_DEBUG

Define RCLCPP_LOG_MIN_SEVERITY=RCLCPP_LOG_MIN_SEVERITY_[DEBUG|INFO|WARN|ERROR|FATAL] in your build options to compile out anything below that severity. Use RCLCPP_LOG_MIN_SEVERITY_NONE to compile out all macros.

◆ RCLCPP_DEBUG

#define RCLCPP_DEBUG (   logger,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
RCUTILS_LOG_DEBUG_NAMED( \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity DEBUG.

Parameters
loggerThe rclcpp::Logger to use
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_DEBUG_ONCE

#define RCLCPP_DEBUG_ONCE (   logger,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
RCUTILS_LOG_DEBUG_ONCE_NAMED( \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity DEBUG with the following conditions: All subsequent log calls except the first one are being ignored.

Parameters
loggerThe rclcpp::Logger to use
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_DEBUG_EXPRESSION

#define RCLCPP_DEBUG_EXPRESSION (   logger,
  expression,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
RCUTILS_LOG_DEBUG_EXPRESSION_NAMED( \
expression, \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity DEBUG with the following conditions: Log calls are being ignored when the expression evaluates to false.

Parameters
loggerThe rclcpp::Logger to use
expressionThe expression determining if the message should be logged
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_DEBUG_FUNCTION

#define RCLCPP_DEBUG_FUNCTION (   logger,
  function,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
RCUTILS_LOG_DEBUG_FUNCTION_NAMED( \
function, \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity DEBUG with the following conditions: Log calls are being ignored when the function returns false.

Parameters
loggerThe rclcpp::Logger to use
functionThe functions return value determines if the message should be logged
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_DEBUG_SKIPFIRST

#define RCLCPP_DEBUG_SKIPFIRST (   logger,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
RCUTILS_LOG_DEBUG_SKIPFIRST_NAMED( \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity DEBUG with the following conditions: The first log call is being ignored but all subsequent calls are being processed.

Parameters
loggerThe rclcpp::Logger to use
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_DEBUG_THROTTLE

#define RCLCPP_DEBUG_THROTTLE (   logger,
  clock,
  duration,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
auto get_time_point = [&c=clock](rcutils_time_point_value_t * time_point) -> rcutils_ret_t { \
try { \
*time_point = c.now().nanoseconds(); \
} catch (...) { \
RCUTILS_SAFE_FWRITE_TO_STDERR( \
"[rclcpp|logging.hpp] RCLCPP_DEBUG_THROTTLE could not get current time stamp\n"); \
} \
return RCUTILS_RET_OK; \
}; \
\
RCUTILS_LOG_DEBUG_THROTTLE_NAMED( \
get_time_point, \
duration, \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity DEBUG with the following conditions: Log calls are being ignored if the last logged message is not longer ago than the specified duration.

Parameters
loggerThe rclcpp::Logger to use
clockrclcpp::Clock that will be used to get the time point.
durationThe duration of the throttle interval
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_DEBUG_SKIPFIRST_THROTTLE

#define RCLCPP_DEBUG_SKIPFIRST_THROTTLE (   logger,
  clock,
  duration,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
auto get_time_point = [&c=clock](rcutils_time_point_value_t * time_point) -> rcutils_ret_t { \
try { \
*time_point = c.now().nanoseconds(); \
} catch (...) { \
RCUTILS_SAFE_FWRITE_TO_STDERR( \
"[rclcpp|logging.hpp] RCLCPP_DEBUG_SKIPFIRST_THROTTLE could not get current time stamp\n"); \
} \
return RCUTILS_RET_OK; \
}; \
\
RCUTILS_LOG_DEBUG_SKIPFIRST_THROTTLE_NAMED( \
get_time_point, \
duration, \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity DEBUG with the following conditions: The first log call is being ignored but all subsequent calls are being processed. Log calls are being ignored if the last logged message is not longer ago than the specified duration.

Parameters
loggerThe rclcpp::Logger to use
clockrclcpp::Clock that will be used to get the time point.
durationThe duration of the throttle interval
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_DEBUG_STREAM

#define RCLCPP_DEBUG_STREAM (   logger,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_DEBUG_NAMED( \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity DEBUG.

Parameters
loggerThe rclcpp::Logger to use
stream_argThe argument << into a stringstream

◆ RCLCPP_DEBUG_STREAM_ONCE

#define RCLCPP_DEBUG_STREAM_ONCE (   logger,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_DEBUG_ONCE_NAMED( \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity DEBUG with the following conditions: All subsequent log calls except the first one are being ignored.

Parameters
loggerThe rclcpp::Logger to use
stream_argThe argument << into a stringstream

◆ RCLCPP_DEBUG_STREAM_EXPRESSION

#define RCLCPP_DEBUG_STREAM_EXPRESSION (   logger,
  expression,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_DEBUG_EXPRESSION_NAMED( \
expression, \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity DEBUG with the following conditions: Log calls are being ignored when the expression evaluates to false.

Parameters
loggerThe rclcpp::Logger to use
expressionThe expression determining if the message should be logged
stream_argThe argument << into a stringstream

◆ RCLCPP_DEBUG_STREAM_FUNCTION

#define RCLCPP_DEBUG_STREAM_FUNCTION (   logger,
  function,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_DEBUG_FUNCTION_NAMED( \
function, \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity DEBUG with the following conditions: Log calls are being ignored when the function returns false.

Parameters
loggerThe rclcpp::Logger to use
functionThe functions return value determines if the message should be logged
stream_argThe argument << into a stringstream

◆ RCLCPP_DEBUG_STREAM_SKIPFIRST

#define RCLCPP_DEBUG_STREAM_SKIPFIRST (   logger,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_DEBUG_SKIPFIRST_NAMED( \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity DEBUG with the following conditions: The first log call is being ignored but all subsequent calls are being processed.

Parameters
loggerThe rclcpp::Logger to use
stream_argThe argument << into a stringstream

◆ RCLCPP_DEBUG_STREAM_THROTTLE

#define RCLCPP_DEBUG_STREAM_THROTTLE (   logger,
  clock,
  duration,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
auto get_time_point = [&c=clock](rcutils_time_point_value_t * time_point) -> rcutils_ret_t { \
try { \
*time_point = c.now().nanoseconds(); \
} catch (...) { \
RCUTILS_SAFE_FWRITE_TO_STDERR( \
"[rclcpp|logging.hpp] RCLCPP_DEBUG_STREAM_THROTTLE could not get current time stamp\n"); \
} \
return RCUTILS_RET_OK; \
}; \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_DEBUG_THROTTLE_NAMED( \
get_time_point, \
duration, \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity DEBUG with the following conditions: Log calls are being ignored if the last logged message is not longer ago than the specified duration.

Parameters
loggerThe rclcpp::Logger to use
clockrclcpp::Clock that will be used to get the time point.
durationThe duration of the throttle interval
stream_argThe argument << into a stringstream

◆ RCLCPP_DEBUG_STREAM_SKIPFIRST_THROTTLE

#define RCLCPP_DEBUG_STREAM_SKIPFIRST_THROTTLE (   logger,
  clock,
  duration,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
auto get_time_point = [&c=clock](rcutils_time_point_value_t * time_point) -> rcutils_ret_t { \
try { \
*time_point = c.now().nanoseconds(); \
} catch (...) { \
RCUTILS_SAFE_FWRITE_TO_STDERR( \
"[rclcpp|logging.hpp] RCLCPP_DEBUG_STREAM_SKIPFIRST_THROTTLE could not get current time stamp\n"); \
} \
return RCUTILS_RET_OK; \
}; \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_DEBUG_SKIPFIRST_THROTTLE_NAMED( \
get_time_point, \
duration, \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity DEBUG with the following conditions: The first log call is being ignored but all subsequent calls are being processed. Log calls are being ignored if the last logged message is not longer ago than the specified duration.

Parameters
loggerThe rclcpp::Logger to use
clockrclcpp::Clock that will be used to get the time point.
durationThe duration of the throttle interval
stream_argThe argument << into a stringstream

◆ RCLCPP_INFO

#define RCLCPP_INFO (   logger,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
RCUTILS_LOG_INFO_NAMED( \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity INFO.

Parameters
loggerThe rclcpp::Logger to use
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_INFO_ONCE

#define RCLCPP_INFO_ONCE (   logger,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
RCUTILS_LOG_INFO_ONCE_NAMED( \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity INFO with the following conditions: All subsequent log calls except the first one are being ignored.

Parameters
loggerThe rclcpp::Logger to use
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_INFO_EXPRESSION

#define RCLCPP_INFO_EXPRESSION (   logger,
  expression,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
RCUTILS_LOG_INFO_EXPRESSION_NAMED( \
expression, \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity INFO with the following conditions: Log calls are being ignored when the expression evaluates to false.

Parameters
loggerThe rclcpp::Logger to use
expressionThe expression determining if the message should be logged
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_INFO_FUNCTION

#define RCLCPP_INFO_FUNCTION (   logger,
  function,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
RCUTILS_LOG_INFO_FUNCTION_NAMED( \
function, \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity INFO with the following conditions: Log calls are being ignored when the function returns false.

Parameters
loggerThe rclcpp::Logger to use
functionThe functions return value determines if the message should be logged
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_INFO_SKIPFIRST

#define RCLCPP_INFO_SKIPFIRST (   logger,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
RCUTILS_LOG_INFO_SKIPFIRST_NAMED( \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity INFO with the following conditions: The first log call is being ignored but all subsequent calls are being processed.

Parameters
loggerThe rclcpp::Logger to use
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_INFO_THROTTLE

#define RCLCPP_INFO_THROTTLE (   logger,
  clock,
  duration,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
auto get_time_point = [&c=clock](rcutils_time_point_value_t * time_point) -> rcutils_ret_t { \
try { \
*time_point = c.now().nanoseconds(); \
} catch (...) { \
RCUTILS_SAFE_FWRITE_TO_STDERR( \
"[rclcpp|logging.hpp] RCLCPP_INFO_THROTTLE could not get current time stamp\n"); \
} \
return RCUTILS_RET_OK; \
}; \
\
RCUTILS_LOG_INFO_THROTTLE_NAMED( \
get_time_point, \
duration, \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity INFO with the following conditions: Log calls are being ignored if the last logged message is not longer ago than the specified duration.

Parameters
loggerThe rclcpp::Logger to use
clockrclcpp::Clock that will be used to get the time point.
durationThe duration of the throttle interval
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_INFO_SKIPFIRST_THROTTLE

#define RCLCPP_INFO_SKIPFIRST_THROTTLE (   logger,
  clock,
  duration,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
auto get_time_point = [&c=clock](rcutils_time_point_value_t * time_point) -> rcutils_ret_t { \
try { \
*time_point = c.now().nanoseconds(); \
} catch (...) { \
RCUTILS_SAFE_FWRITE_TO_STDERR( \
"[rclcpp|logging.hpp] RCLCPP_INFO_SKIPFIRST_THROTTLE could not get current time stamp\n"); \
} \
return RCUTILS_RET_OK; \
}; \
\
RCUTILS_LOG_INFO_SKIPFIRST_THROTTLE_NAMED( \
get_time_point, \
duration, \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity INFO with the following conditions: The first log call is being ignored but all subsequent calls are being processed. Log calls are being ignored if the last logged message is not longer ago than the specified duration.

Parameters
loggerThe rclcpp::Logger to use
clockrclcpp::Clock that will be used to get the time point.
durationThe duration of the throttle interval
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_INFO_STREAM

#define RCLCPP_INFO_STREAM (   logger,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_INFO_NAMED( \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity INFO.

Parameters
loggerThe rclcpp::Logger to use
stream_argThe argument << into a stringstream

◆ RCLCPP_INFO_STREAM_ONCE

#define RCLCPP_INFO_STREAM_ONCE (   logger,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_INFO_ONCE_NAMED( \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity INFO with the following conditions: All subsequent log calls except the first one are being ignored.

Parameters
loggerThe rclcpp::Logger to use
stream_argThe argument << into a stringstream

◆ RCLCPP_INFO_STREAM_EXPRESSION

#define RCLCPP_INFO_STREAM_EXPRESSION (   logger,
  expression,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_INFO_EXPRESSION_NAMED( \
expression, \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity INFO with the following conditions: Log calls are being ignored when the expression evaluates to false.

Parameters
loggerThe rclcpp::Logger to use
expressionThe expression determining if the message should be logged
stream_argThe argument << into a stringstream

◆ RCLCPP_INFO_STREAM_FUNCTION

#define RCLCPP_INFO_STREAM_FUNCTION (   logger,
  function,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_INFO_FUNCTION_NAMED( \
function, \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity INFO with the following conditions: Log calls are being ignored when the function returns false.

Parameters
loggerThe rclcpp::Logger to use
functionThe functions return value determines if the message should be logged
stream_argThe argument << into a stringstream

◆ RCLCPP_INFO_STREAM_SKIPFIRST

#define RCLCPP_INFO_STREAM_SKIPFIRST (   logger,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_INFO_SKIPFIRST_NAMED( \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity INFO with the following conditions: The first log call is being ignored but all subsequent calls are being processed.

Parameters
loggerThe rclcpp::Logger to use
stream_argThe argument << into a stringstream

◆ RCLCPP_INFO_STREAM_THROTTLE

#define RCLCPP_INFO_STREAM_THROTTLE (   logger,
  clock,
  duration,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
auto get_time_point = [&c=clock](rcutils_time_point_value_t * time_point) -> rcutils_ret_t { \
try { \
*time_point = c.now().nanoseconds(); \
} catch (...) { \
RCUTILS_SAFE_FWRITE_TO_STDERR( \
"[rclcpp|logging.hpp] RCLCPP_INFO_STREAM_THROTTLE could not get current time stamp\n"); \
} \
return RCUTILS_RET_OK; \
}; \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_INFO_THROTTLE_NAMED( \
get_time_point, \
duration, \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity INFO with the following conditions: Log calls are being ignored if the last logged message is not longer ago than the specified duration.

Parameters
loggerThe rclcpp::Logger to use
clockrclcpp::Clock that will be used to get the time point.
durationThe duration of the throttle interval
stream_argThe argument << into a stringstream

◆ RCLCPP_INFO_STREAM_SKIPFIRST_THROTTLE

#define RCLCPP_INFO_STREAM_SKIPFIRST_THROTTLE (   logger,
  clock,
  duration,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
auto get_time_point = [&c=clock](rcutils_time_point_value_t * time_point) -> rcutils_ret_t { \
try { \
*time_point = c.now().nanoseconds(); \
} catch (...) { \
RCUTILS_SAFE_FWRITE_TO_STDERR( \
"[rclcpp|logging.hpp] RCLCPP_INFO_STREAM_SKIPFIRST_THROTTLE could not get current time stamp\n"); \
} \
return RCUTILS_RET_OK; \
}; \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_INFO_SKIPFIRST_THROTTLE_NAMED( \
get_time_point, \
duration, \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity INFO with the following conditions: The first log call is being ignored but all subsequent calls are being processed. Log calls are being ignored if the last logged message is not longer ago than the specified duration.

Parameters
loggerThe rclcpp::Logger to use
clockrclcpp::Clock that will be used to get the time point.
durationThe duration of the throttle interval
stream_argThe argument << into a stringstream

◆ RCLCPP_WARN

#define RCLCPP_WARN (   logger,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
RCUTILS_LOG_WARN_NAMED( \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity WARN.

Parameters
loggerThe rclcpp::Logger to use
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_WARN_ONCE

#define RCLCPP_WARN_ONCE (   logger,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
RCUTILS_LOG_WARN_ONCE_NAMED( \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity WARN with the following conditions: All subsequent log calls except the first one are being ignored.

Parameters
loggerThe rclcpp::Logger to use
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_WARN_EXPRESSION

#define RCLCPP_WARN_EXPRESSION (   logger,
  expression,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
RCUTILS_LOG_WARN_EXPRESSION_NAMED( \
expression, \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity WARN with the following conditions: Log calls are being ignored when the expression evaluates to false.

Parameters
loggerThe rclcpp::Logger to use
expressionThe expression determining if the message should be logged
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_WARN_FUNCTION

#define RCLCPP_WARN_FUNCTION (   logger,
  function,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
RCUTILS_LOG_WARN_FUNCTION_NAMED( \
function, \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity WARN with the following conditions: Log calls are being ignored when the function returns false.

Parameters
loggerThe rclcpp::Logger to use
functionThe functions return value determines if the message should be logged
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_WARN_SKIPFIRST

#define RCLCPP_WARN_SKIPFIRST (   logger,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
RCUTILS_LOG_WARN_SKIPFIRST_NAMED( \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity WARN with the following conditions: The first log call is being ignored but all subsequent calls are being processed.

Parameters
loggerThe rclcpp::Logger to use
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_WARN_THROTTLE

#define RCLCPP_WARN_THROTTLE (   logger,
  clock,
  duration,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
auto get_time_point = [&c=clock](rcutils_time_point_value_t * time_point) -> rcutils_ret_t { \
try { \
*time_point = c.now().nanoseconds(); \
} catch (...) { \
RCUTILS_SAFE_FWRITE_TO_STDERR( \
"[rclcpp|logging.hpp] RCLCPP_WARN_THROTTLE could not get current time stamp\n"); \
} \
return RCUTILS_RET_OK; \
}; \
\
RCUTILS_LOG_WARN_THROTTLE_NAMED( \
get_time_point, \
duration, \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity WARN with the following conditions: Log calls are being ignored if the last logged message is not longer ago than the specified duration.

Parameters
loggerThe rclcpp::Logger to use
clockrclcpp::Clock that will be used to get the time point.
durationThe duration of the throttle interval
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_WARN_SKIPFIRST_THROTTLE

#define RCLCPP_WARN_SKIPFIRST_THROTTLE (   logger,
  clock,
  duration,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
auto get_time_point = [&c=clock](rcutils_time_point_value_t * time_point) -> rcutils_ret_t { \
try { \
*time_point = c.now().nanoseconds(); \
} catch (...) { \
RCUTILS_SAFE_FWRITE_TO_STDERR( \
"[rclcpp|logging.hpp] RCLCPP_WARN_SKIPFIRST_THROTTLE could not get current time stamp\n"); \
} \
return RCUTILS_RET_OK; \
}; \
\
RCUTILS_LOG_WARN_SKIPFIRST_THROTTLE_NAMED( \
get_time_point, \
duration, \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity WARN with the following conditions: The first log call is being ignored but all subsequent calls are being processed. Log calls are being ignored if the last logged message is not longer ago than the specified duration.

Parameters
loggerThe rclcpp::Logger to use
clockrclcpp::Clock that will be used to get the time point.
durationThe duration of the throttle interval
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_WARN_STREAM

#define RCLCPP_WARN_STREAM (   logger,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_WARN_NAMED( \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity WARN.

Parameters
loggerThe rclcpp::Logger to use
stream_argThe argument << into a stringstream

◆ RCLCPP_WARN_STREAM_ONCE

#define RCLCPP_WARN_STREAM_ONCE (   logger,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_WARN_ONCE_NAMED( \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity WARN with the following conditions: All subsequent log calls except the first one are being ignored.

Parameters
loggerThe rclcpp::Logger to use
stream_argThe argument << into a stringstream

◆ RCLCPP_WARN_STREAM_EXPRESSION

#define RCLCPP_WARN_STREAM_EXPRESSION (   logger,
  expression,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_WARN_EXPRESSION_NAMED( \
expression, \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity WARN with the following conditions: Log calls are being ignored when the expression evaluates to false.

Parameters
loggerThe rclcpp::Logger to use
expressionThe expression determining if the message should be logged
stream_argThe argument << into a stringstream

◆ RCLCPP_WARN_STREAM_FUNCTION

#define RCLCPP_WARN_STREAM_FUNCTION (   logger,
  function,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_WARN_FUNCTION_NAMED( \
function, \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity WARN with the following conditions: Log calls are being ignored when the function returns false.

Parameters
loggerThe rclcpp::Logger to use
functionThe functions return value determines if the message should be logged
stream_argThe argument << into a stringstream

◆ RCLCPP_WARN_STREAM_SKIPFIRST

#define RCLCPP_WARN_STREAM_SKIPFIRST (   logger,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_WARN_SKIPFIRST_NAMED( \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity WARN with the following conditions: The first log call is being ignored but all subsequent calls are being processed.

Parameters
loggerThe rclcpp::Logger to use
stream_argThe argument << into a stringstream

◆ RCLCPP_WARN_STREAM_THROTTLE

#define RCLCPP_WARN_STREAM_THROTTLE (   logger,
  clock,
  duration,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
auto get_time_point = [&c=clock](rcutils_time_point_value_t * time_point) -> rcutils_ret_t { \
try { \
*time_point = c.now().nanoseconds(); \
} catch (...) { \
RCUTILS_SAFE_FWRITE_TO_STDERR( \
"[rclcpp|logging.hpp] RCLCPP_WARN_STREAM_THROTTLE could not get current time stamp\n"); \
} \
return RCUTILS_RET_OK; \
}; \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_WARN_THROTTLE_NAMED( \
get_time_point, \
duration, \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity WARN with the following conditions: Log calls are being ignored if the last logged message is not longer ago than the specified duration.

Parameters
loggerThe rclcpp::Logger to use
clockrclcpp::Clock that will be used to get the time point.
durationThe duration of the throttle interval
stream_argThe argument << into a stringstream

◆ RCLCPP_WARN_STREAM_SKIPFIRST_THROTTLE

#define RCLCPP_WARN_STREAM_SKIPFIRST_THROTTLE (   logger,
  clock,
  duration,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
auto get_time_point = [&c=clock](rcutils_time_point_value_t * time_point) -> rcutils_ret_t { \
try { \
*time_point = c.now().nanoseconds(); \
} catch (...) { \
RCUTILS_SAFE_FWRITE_TO_STDERR( \
"[rclcpp|logging.hpp] RCLCPP_WARN_STREAM_SKIPFIRST_THROTTLE could not get current time stamp\n"); \
} \
return RCUTILS_RET_OK; \
}; \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_WARN_SKIPFIRST_THROTTLE_NAMED( \
get_time_point, \
duration, \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity WARN with the following conditions: The first log call is being ignored but all subsequent calls are being processed. Log calls are being ignored if the last logged message is not longer ago than the specified duration.

Parameters
loggerThe rclcpp::Logger to use
clockrclcpp::Clock that will be used to get the time point.
durationThe duration of the throttle interval
stream_argThe argument << into a stringstream

◆ RCLCPP_ERROR

#define RCLCPP_ERROR (   logger,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
RCUTILS_LOG_ERROR_NAMED( \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity ERROR.

Parameters
loggerThe rclcpp::Logger to use
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_ERROR_ONCE

#define RCLCPP_ERROR_ONCE (   logger,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
RCUTILS_LOG_ERROR_ONCE_NAMED( \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity ERROR with the following conditions: All subsequent log calls except the first one are being ignored.

Parameters
loggerThe rclcpp::Logger to use
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_ERROR_EXPRESSION

#define RCLCPP_ERROR_EXPRESSION (   logger,
  expression,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
RCUTILS_LOG_ERROR_EXPRESSION_NAMED( \
expression, \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity ERROR with the following conditions: Log calls are being ignored when the expression evaluates to false.

Parameters
loggerThe rclcpp::Logger to use
expressionThe expression determining if the message should be logged
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_ERROR_FUNCTION

#define RCLCPP_ERROR_FUNCTION (   logger,
  function,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
RCUTILS_LOG_ERROR_FUNCTION_NAMED( \
function, \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity ERROR with the following conditions: Log calls are being ignored when the function returns false.

Parameters
loggerThe rclcpp::Logger to use
functionThe functions return value determines if the message should be logged
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_ERROR_SKIPFIRST

#define RCLCPP_ERROR_SKIPFIRST (   logger,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
RCUTILS_LOG_ERROR_SKIPFIRST_NAMED( \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity ERROR with the following conditions: The first log call is being ignored but all subsequent calls are being processed.

Parameters
loggerThe rclcpp::Logger to use
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_ERROR_THROTTLE

#define RCLCPP_ERROR_THROTTLE (   logger,
  clock,
  duration,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
auto get_time_point = [&c=clock](rcutils_time_point_value_t * time_point) -> rcutils_ret_t { \
try { \
*time_point = c.now().nanoseconds(); \
} catch (...) { \
RCUTILS_SAFE_FWRITE_TO_STDERR( \
"[rclcpp|logging.hpp] RCLCPP_ERROR_THROTTLE could not get current time stamp\n"); \
} \
return RCUTILS_RET_OK; \
}; \
\
RCUTILS_LOG_ERROR_THROTTLE_NAMED( \
get_time_point, \
duration, \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity ERROR with the following conditions: Log calls are being ignored if the last logged message is not longer ago than the specified duration.

Parameters
loggerThe rclcpp::Logger to use
clockrclcpp::Clock that will be used to get the time point.
durationThe duration of the throttle interval
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_ERROR_SKIPFIRST_THROTTLE

#define RCLCPP_ERROR_SKIPFIRST_THROTTLE (   logger,
  clock,
  duration,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
auto get_time_point = [&c=clock](rcutils_time_point_value_t * time_point) -> rcutils_ret_t { \
try { \
*time_point = c.now().nanoseconds(); \
} catch (...) { \
RCUTILS_SAFE_FWRITE_TO_STDERR( \
"[rclcpp|logging.hpp] RCLCPP_ERROR_SKIPFIRST_THROTTLE could not get current time stamp\n"); \
} \
return RCUTILS_RET_OK; \
}; \
\
RCUTILS_LOG_ERROR_SKIPFIRST_THROTTLE_NAMED( \
get_time_point, \
duration, \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity ERROR with the following conditions: The first log call is being ignored but all subsequent calls are being processed. Log calls are being ignored if the last logged message is not longer ago than the specified duration.

Parameters
loggerThe rclcpp::Logger to use
clockrclcpp::Clock that will be used to get the time point.
durationThe duration of the throttle interval
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_ERROR_STREAM

#define RCLCPP_ERROR_STREAM (   logger,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_ERROR_NAMED( \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity ERROR.

Parameters
loggerThe rclcpp::Logger to use
stream_argThe argument << into a stringstream

◆ RCLCPP_ERROR_STREAM_ONCE

#define RCLCPP_ERROR_STREAM_ONCE (   logger,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_ERROR_ONCE_NAMED( \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity ERROR with the following conditions: All subsequent log calls except the first one are being ignored.

Parameters
loggerThe rclcpp::Logger to use
stream_argThe argument << into a stringstream

◆ RCLCPP_ERROR_STREAM_EXPRESSION

#define RCLCPP_ERROR_STREAM_EXPRESSION (   logger,
  expression,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_ERROR_EXPRESSION_NAMED( \
expression, \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity ERROR with the following conditions: Log calls are being ignored when the expression evaluates to false.

Parameters
loggerThe rclcpp::Logger to use
expressionThe expression determining if the message should be logged
stream_argThe argument << into a stringstream

◆ RCLCPP_ERROR_STREAM_FUNCTION

#define RCLCPP_ERROR_STREAM_FUNCTION (   logger,
  function,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_ERROR_FUNCTION_NAMED( \
function, \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity ERROR with the following conditions: Log calls are being ignored when the function returns false.

Parameters
loggerThe rclcpp::Logger to use
functionThe functions return value determines if the message should be logged
stream_argThe argument << into a stringstream

◆ RCLCPP_ERROR_STREAM_SKIPFIRST

#define RCLCPP_ERROR_STREAM_SKIPFIRST (   logger,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_ERROR_SKIPFIRST_NAMED( \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity ERROR with the following conditions: The first log call is being ignored but all subsequent calls are being processed.

Parameters
loggerThe rclcpp::Logger to use
stream_argThe argument << into a stringstream

◆ RCLCPP_ERROR_STREAM_THROTTLE

#define RCLCPP_ERROR_STREAM_THROTTLE (   logger,
  clock,
  duration,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
auto get_time_point = [&c=clock](rcutils_time_point_value_t * time_point) -> rcutils_ret_t { \
try { \
*time_point = c.now().nanoseconds(); \
} catch (...) { \
RCUTILS_SAFE_FWRITE_TO_STDERR( \
"[rclcpp|logging.hpp] RCLCPP_ERROR_STREAM_THROTTLE could not get current time stamp\n"); \
} \
return RCUTILS_RET_OK; \
}; \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_ERROR_THROTTLE_NAMED( \
get_time_point, \
duration, \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity ERROR with the following conditions: Log calls are being ignored if the last logged message is not longer ago than the specified duration.

Parameters
loggerThe rclcpp::Logger to use
clockrclcpp::Clock that will be used to get the time point.
durationThe duration of the throttle interval
stream_argThe argument << into a stringstream

◆ RCLCPP_ERROR_STREAM_SKIPFIRST_THROTTLE

#define RCLCPP_ERROR_STREAM_SKIPFIRST_THROTTLE (   logger,
  clock,
  duration,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
auto get_time_point = [&c=clock](rcutils_time_point_value_t * time_point) -> rcutils_ret_t { \
try { \
*time_point = c.now().nanoseconds(); \
} catch (...) { \
RCUTILS_SAFE_FWRITE_TO_STDERR( \
"[rclcpp|logging.hpp] RCLCPP_ERROR_STREAM_SKIPFIRST_THROTTLE could not get current time stamp\n"); \
} \
return RCUTILS_RET_OK; \
}; \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_ERROR_SKIPFIRST_THROTTLE_NAMED( \
get_time_point, \
duration, \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity ERROR with the following conditions: The first log call is being ignored but all subsequent calls are being processed. Log calls are being ignored if the last logged message is not longer ago than the specified duration.

Parameters
loggerThe rclcpp::Logger to use
clockrclcpp::Clock that will be used to get the time point.
durationThe duration of the throttle interval
stream_argThe argument << into a stringstream

◆ RCLCPP_FATAL

#define RCLCPP_FATAL (   logger,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
RCUTILS_LOG_FATAL_NAMED( \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity FATAL.

Parameters
loggerThe rclcpp::Logger to use
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_FATAL_ONCE

#define RCLCPP_FATAL_ONCE (   logger,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
RCUTILS_LOG_FATAL_ONCE_NAMED( \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity FATAL with the following conditions: All subsequent log calls except the first one are being ignored.

Parameters
loggerThe rclcpp::Logger to use
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_FATAL_EXPRESSION

#define RCLCPP_FATAL_EXPRESSION (   logger,
  expression,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
RCUTILS_LOG_FATAL_EXPRESSION_NAMED( \
expression, \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity FATAL with the following conditions: Log calls are being ignored when the expression evaluates to false.

Parameters
loggerThe rclcpp::Logger to use
expressionThe expression determining if the message should be logged
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_FATAL_FUNCTION

#define RCLCPP_FATAL_FUNCTION (   logger,
  function,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
RCUTILS_LOG_FATAL_FUNCTION_NAMED( \
function, \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity FATAL with the following conditions: Log calls are being ignored when the function returns false.

Parameters
loggerThe rclcpp::Logger to use
functionThe functions return value determines if the message should be logged
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_FATAL_SKIPFIRST

#define RCLCPP_FATAL_SKIPFIRST (   logger,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
RCUTILS_LOG_FATAL_SKIPFIRST_NAMED( \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity FATAL with the following conditions: The first log call is being ignored but all subsequent calls are being processed.

Parameters
loggerThe rclcpp::Logger to use
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_FATAL_THROTTLE

#define RCLCPP_FATAL_THROTTLE (   logger,
  clock,
  duration,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
auto get_time_point = [&c=clock](rcutils_time_point_value_t * time_point) -> rcutils_ret_t { \
try { \
*time_point = c.now().nanoseconds(); \
} catch (...) { \
RCUTILS_SAFE_FWRITE_TO_STDERR( \
"[rclcpp|logging.hpp] RCLCPP_FATAL_THROTTLE could not get current time stamp\n"); \
} \
return RCUTILS_RET_OK; \
}; \
\
RCUTILS_LOG_FATAL_THROTTLE_NAMED( \
get_time_point, \
duration, \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity FATAL with the following conditions: Log calls are being ignored if the last logged message is not longer ago than the specified duration.

Parameters
loggerThe rclcpp::Logger to use
clockrclcpp::Clock that will be used to get the time point.
durationThe duration of the throttle interval
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_FATAL_SKIPFIRST_THROTTLE

#define RCLCPP_FATAL_SKIPFIRST_THROTTLE (   logger,
  clock,
  duration,
  ... 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
auto get_time_point = [&c=clock](rcutils_time_point_value_t * time_point) -> rcutils_ret_t { \
try { \
*time_point = c.now().nanoseconds(); \
} catch (...) { \
RCUTILS_SAFE_FWRITE_TO_STDERR( \
"[rclcpp|logging.hpp] RCLCPP_FATAL_SKIPFIRST_THROTTLE could not get current time stamp\n"); \
} \
return RCUTILS_RET_OK; \
}; \
\
RCUTILS_LOG_FATAL_SKIPFIRST_THROTTLE_NAMED( \
get_time_point, \
duration, \
logger.get_name(), \
__VA_ARGS__); \
} while (0)

Log a message with severity FATAL with the following conditions: The first log call is being ignored but all subsequent calls are being processed. Log calls are being ignored if the last logged message is not longer ago than the specified duration.

Parameters
loggerThe rclcpp::Logger to use
clockrclcpp::Clock that will be used to get the time point.
durationThe duration of the throttle interval
...The format string, followed by the variable arguments for the format string. It also accepts a single argument of type std::string.

◆ RCLCPP_FATAL_STREAM

#define RCLCPP_FATAL_STREAM (   logger,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_FATAL_NAMED( \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity FATAL.

Parameters
loggerThe rclcpp::Logger to use
stream_argThe argument << into a stringstream

◆ RCLCPP_FATAL_STREAM_ONCE

#define RCLCPP_FATAL_STREAM_ONCE (   logger,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_FATAL_ONCE_NAMED( \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity FATAL with the following conditions: All subsequent log calls except the first one are being ignored.

Parameters
loggerThe rclcpp::Logger to use
stream_argThe argument << into a stringstream

◆ RCLCPP_FATAL_STREAM_EXPRESSION

#define RCLCPP_FATAL_STREAM_EXPRESSION (   logger,
  expression,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_FATAL_EXPRESSION_NAMED( \
expression, \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity FATAL with the following conditions: Log calls are being ignored when the expression evaluates to false.

Parameters
loggerThe rclcpp::Logger to use
expressionThe expression determining if the message should be logged
stream_argThe argument << into a stringstream

◆ RCLCPP_FATAL_STREAM_FUNCTION

#define RCLCPP_FATAL_STREAM_FUNCTION (   logger,
  function,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_FATAL_FUNCTION_NAMED( \
function, \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity FATAL with the following conditions: Log calls are being ignored when the function returns false.

Parameters
loggerThe rclcpp::Logger to use
functionThe functions return value determines if the message should be logged
stream_argThe argument << into a stringstream

◆ RCLCPP_FATAL_STREAM_SKIPFIRST

#define RCLCPP_FATAL_STREAM_SKIPFIRST (   logger,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_FATAL_SKIPFIRST_NAMED( \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity FATAL with the following conditions: The first log call is being ignored but all subsequent calls are being processed.

Parameters
loggerThe rclcpp::Logger to use
stream_argThe argument << into a stringstream

◆ RCLCPP_FATAL_STREAM_THROTTLE

#define RCLCPP_FATAL_STREAM_THROTTLE (   logger,
  clock,
  duration,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
auto get_time_point = [&c=clock](rcutils_time_point_value_t * time_point) -> rcutils_ret_t { \
try { \
*time_point = c.now().nanoseconds(); \
} catch (...) { \
RCUTILS_SAFE_FWRITE_TO_STDERR( \
"[rclcpp|logging.hpp] RCLCPP_FATAL_STREAM_THROTTLE could not get current time stamp\n"); \
} \
return RCUTILS_RET_OK; \
}; \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_FATAL_THROTTLE_NAMED( \
get_time_point, \
duration, \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity FATAL with the following conditions: Log calls are being ignored if the last logged message is not longer ago than the specified duration.

Parameters
loggerThe rclcpp::Logger to use
clockrclcpp::Clock that will be used to get the time point.
durationThe duration of the throttle interval
stream_argThe argument << into a stringstream

◆ RCLCPP_FATAL_STREAM_SKIPFIRST_THROTTLE

#define RCLCPP_FATAL_STREAM_SKIPFIRST_THROTTLE (   logger,
  clock,
  duration,
  stream_arg 
)
Value:
do { \
static_assert( \
::std::is_same<typename std::remove_cv<typename std::remove_reference<decltype(logger)>::type>::type, \
typename ::rclcpp::Logger>::value, \
"First argument to logging macros must be an rclcpp::Logger"); \
\
auto get_time_point = [&c=clock](rcutils_time_point_value_t * time_point) -> rcutils_ret_t { \
try { \
*time_point = c.now().nanoseconds(); \
} catch (...) { \
RCUTILS_SAFE_FWRITE_TO_STDERR( \
"[rclcpp|logging.hpp] RCLCPP_FATAL_STREAM_SKIPFIRST_THROTTLE could not get current time stamp\n"); \
} \
return RCUTILS_RET_OK; \
}; \
\
std::stringstream ss; \
ss << stream_arg; \
RCUTILS_LOG_FATAL_SKIPFIRST_THROTTLE_NAMED( \
get_time_point, \
duration, \
logger.get_name(), \
"%s", ss.str().c_str()); \
} while (0)

Log a message with severity FATAL with the following conditions: The first log call is being ignored but all subsequent calls are being processed. Log calls are being ignored if the last logged message is not longer ago than the specified duration.

Parameters
loggerThe rclcpp::Logger to use
clockrclcpp::Clock that will be used to get the time point.
durationThe duration of the throttle interval
stream_argThe argument << into a stringstream
std::is_same
RCUTILS_RET_ERROR
#define RCUTILS_RET_ERROR
std::clock
T clock(T... args)
rcutils_ret_t
int rcutils_ret_t
rcutils_time_point_value_t
int64_t rcutils_time_point_value_t
std::remove_reference
std::remove_cv
RCUTILS_RET_OK
#define RCUTILS_RET_OK