ROS 2 rclcpp + rcl - jazzy
jazzy
ROS 2 C++ Client Library with ROS Client Library
|
#include "rcl/allocator.h"
#include "rcl/arguments.h"
#include "rcl/macros.h"
#include "rcl/types.h"
#include "rcl/visibility_control.h"
#include "rcutils/logging.h"
Go to the source code of this file.
Typedefs | |
typedef rcutils_logging_output_handler_t | rcl_logging_output_handler_t |
The function signature to log messages. | |
Functions | |
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t | rcl_logging_configure (const rcl_arguments_t *global_args, const rcl_allocator_t *allocator) |
Configure the logging system. More... | |
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t | rcl_logging_configure_with_output_handler (const rcl_arguments_t *global_args, const rcl_allocator_t *allocator, rcl_logging_output_handler_t output_handler) |
Configure the logging system with the provided output handler. More... | |
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t | rcl_logging_fini (void) |
RCL_PUBLIC RCL_WARN_UNUSED bool | rcl_logging_rosout_enabled (void) |
See if logging rosout is enabled. More... | |
RCL_PUBLIC void | rcl_logging_multiple_output_handler (const rcutils_log_location_t *location, int severity, const char *name, rcutils_time_point_value_t timestamp, const char *format, va_list *args) |
Default output handler used by rcl. More... | |
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_logging_configure | ( | const rcl_arguments_t * | global_args, |
const rcl_allocator_t * | allocator | ||
) |
Configure the logging system.
This function should be called during the ROS initialization process. It will add the enabled log output appenders to the root logger.
Attribute | Adherence |
---|---|
Allocates Memory | Yes |
Thread-Safe | No |
Uses Atomics | No |
Lock-Free | Yes |
[in] | global_args | The global arguments for the system |
[in] | allocator | Used to allocate memory used by the logging system |
Definition at line 121 of file logging.c.
References rcl_logging_configure_with_output_handler(), and rcl_logging_multiple_output_handler().
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_logging_configure_with_output_handler | ( | const rcl_arguments_t * | global_args, |
const rcl_allocator_t * | allocator, | ||
rcl_logging_output_handler_t | output_handler | ||
) |
Configure the logging system with the provided output handler.
Similar to rcl_logging_configure, but it uses the provided output handler.
Attribute | Adherence |
---|---|
Allocates Memory | Yes |
Thread-Safe | No |
Uses Atomics | No |
Lock-Free | Yes |
[in] | global_args | The global arguments for the system |
[in] | allocator | Used to allocate memory used by the logging system |
[in] | output_handler | Output handler to be installed |
Definition at line 57 of file logging.c.
References rcl_log_levels_s::default_logger_level, rcl_arguments_impl_s::external_log_config_file, rcl_arguments_impl_s::external_log_file_name_prefix, rcl_arguments_s::impl, rcl_logger_setting_s::level, rcl_arguments_impl_s::log_ext_lib_disabled, rcl_arguments_impl_s::log_levels, rcl_arguments_impl_s::log_rosout_disabled, rcl_arguments_impl_s::log_stdout_disabled, rcl_log_levels_s::logger_settings, rcl_logger_setting_s::name, rcl_log_levels_s::num_logger_settings, RCL_CHECK_ALLOCATOR_WITH_MSG, rcl_logging_rosout_init(), rcl_logging_rosout_output_handler(), RCL_RET_ERROR, RCL_RET_INVALID_ARGUMENT, and RCL_RET_OK.
Referenced by rclcpp::Context::init(), and rcl_logging_configure().
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_logging_fini | ( | void | ) |
This function should be called to tear down the logging setup by the configure function.
Attribute | Adherence |
---|---|
Allocates Memory | No |
Thread-Safe | No |
Uses Atomics | No |
Lock-Free | Yes |
Definition at line 127 of file logging.c.
References rcl_logging_rosout_fini(), and RCL_RET_OK.
Referenced by rclcpp::Context::shutdown().
RCL_PUBLIC void rcl_logging_multiple_output_handler | ( | const rcutils_log_location_t * | location, |
int | severity, | ||
const char * | name, | ||
rcutils_time_point_value_t | timestamp, | ||
const char * | format, | ||
va_list * | args | ||
) |
Default output handler used by rcl.
This function can be wrapped in a language specific client library, adding the necessary mutual exclusion protection there, and then use rcl_logging_configure_with_output_handler() instead of rcl_logging_configure().
Attribute | Adherence |
---|---|
Allocates Memory | No |
Thread-Safe | Yes |
Uses Atomics | No |
Lock-Free | Yes |
[in] | location | The pointer to the location struct or NULL |
[in] | severity | The severity level |
[in] | name | The name of the logger, must be null terminated c string |
[in] | timestamp | The timestamp for when the log message was made |
[in] | format | The list of arguments to insert into the formatted log message |
[in] | args | argument for the string format |
Definition at line 154 of file logging.c.
Referenced by rcl_logging_configure().
RCL_PUBLIC RCL_WARN_UNUSED bool rcl_logging_rosout_enabled | ( | void | ) |
See if logging rosout is enabled.
This function is meant to be used to check if logging rosout is enabled.
Attribute | Adherence |
---|---|
Allocates Memory | No |
Thread-Safe | Yes |
Uses Atomics | No |
Lock-Free | Yes |
TRUE
if logging rosout is enabled, or FALSE
if logging rosout is disabled. Definition at line 148 of file logging.c.
Referenced by rclcpp::node_interfaces::NodeBase::NodeBase().