rcl_logging_spdlog
master
Implementation of rcl_logging API for an spdlog backend.
|
Go to the source code of this file.
Enumerations | |
enum | rcl_logging_ret_t { RCL_LOGGING_RET_OK = 0, RCL_LOGGING_RET_ERROR = 2, RCL_LOGGING_RET_INVALID_ARGUMENT = 11, RCL_LOGGING_RET_CONFIG_FILE_DOESNT_EXIST = 21, RCL_LOGGING_RET_CONFIG_FILE_INVALID = 22 } |
Functions | |
RCL_LOGGING_INTERFACE_PUBLIC RCUTILS_WARN_UNUSED rcl_logging_ret_t | rcl_logging_external_initialize (const char *config_file, rcutils_allocator_t allocator) |
Initialize the external logging library. More... | |
RCL_LOGGING_INTERFACE_PUBLIC RCUTILS_WARN_UNUSED rcl_logging_ret_t | rcl_logging_external_shutdown () |
Free the resources allocated for the external logging system. More... | |
RCL_LOGGING_INTERFACE_PUBLIC void | rcl_logging_external_log (int severity, const char *name, const char *msg) |
Log a message. More... | |
RCL_LOGGING_INTERFACE_PUBLIC RCUTILS_WARN_UNUSED rcl_logging_ret_t | rcl_logging_external_set_logger_level (const char *name, int level) |
Set the severity level for a logger. More... | |
RCL_LOGGING_INTERFACE_PUBLIC rcl_logging_ret_t | rcl_logging_get_logging_directory (rcutils_allocator_t allocator, char **directory) |
Get the logging directory. More... | |
enum rcl_logging_ret_t |
RCL_LOGGING_INTERFACE_PUBLIC RCUTILS_WARN_UNUSED rcl_logging_ret_t rcl_logging_external_initialize | ( | const char * | config_file, |
rcutils_allocator_t | allocator | ||
) |
Initialize the external logging library.
[in] | config_file | The location of a config file that the external logging library should use to configure itself. If provided, it must be a null terminated C string. If set to NULL or the empty string, the logging library will use defaults. |
[in] | allocator | The allocator to use for memory allocation. This is an rcutils_allocator_t rather than an rcl_allocator_t to ensure that the rcl_logging_* packages don't have a circular dependency back to rcl. |
RCL_LOGGING_INTERFACE_PUBLIC RCUTILS_WARN_UNUSED rcl_logging_ret_t rcl_logging_external_shutdown | ( | ) |
Free the resources allocated for the external logging system.
This puts the system into a state equivalent to being uninitialized.
RCL_LOGGING_INTERFACE_PUBLIC void rcl_logging_external_log | ( | int | severity, |
const char * | name, | ||
const char * | msg | ||
) |
Log a message.
[in] | severity | The severity level of the message being logged. |
[in] | name | The name of the logger, must either be a null terminated C string or NULL. If NULL or empty the root logger will be used. |
[in] | msg | The message to be logged. Must be a null terminated C string. |
RCL_LOGGING_INTERFACE_PUBLIC RCUTILS_WARN_UNUSED rcl_logging_ret_t rcl_logging_external_set_logger_level | ( | const char * | name, |
int | level | ||
) |
Set the severity level for a logger.
This function sets the severity level for the specified logger. If the name provided is an empty string or NULL it will change the level of the root logger.
[in] | name | The name of the logger. Must be a null terminated C string or NULL. |
[in] | level | The severity level to be used for the specified logger. |
RCL_LOGGING_INTERFACE_PUBLIC rcl_logging_ret_t rcl_logging_get_logging_directory | ( | rcutils_allocator_t | allocator, |
char ** | directory | ||
) |
Get the logging directory.
Uses various environment variables to construct a logging directory path.
Use $ROS_LOG_DIR if ROS_LOG_DIR is set and not empty. Otherwise, use $ROS_HOME/log, using ~/.ros for ROS_HOME if not set or if empty.
It also expands an initial '~' to the current user's home directory, and converts the path separator if necessary.
If successful, the directory C string should be deallocated using the given allocator when it is no longer needed.
[in] | allocator | The allocator to use for memory allocation. |
[out] | directory | The C string pointer at which to write the directory path. Only meaningful if the call is successful. Must not be nullptr and must point to nullptr. |