rcl  master
C API providing common ROS client library functionality.
Typedefs | Functions
logging.h File Reference
#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"
Include dependency graph for 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_ret_t rcl_logging_configure (const rcl_arguments_t *global_args, const rcl_allocator_t *allocator)
 Configure the logging system. More...
 
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_ret_t rcl_logging_fini (void)
 
bool rcl_logging_rosout_enabled (void)
 See if logging rosout is enabled. More...
 
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...
 

Function Documentation

◆ rcl_logging_configure()

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
Parameters
[in]global_argsThe global arguments for the system
[in]allocatorUsed to allocate memory used by the logging system
Returns
RCL_RET_OK if successful, or
RCL_RET_BAD_ALLOC if allocating memory failed, or
RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or
RCL_RET_ERROR if a general error occurs

◆ rcl_logging_configure_with_output_handler()

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.

See also
rcl_logging_configure

Attribute Adherence
Allocates Memory Yes
Thread-Safe No
Uses Atomics No
Lock-Free Yes
Parameters
[in]global_argsThe global arguments for the system
[in]allocatorUsed to allocate memory used by the logging system
[in]output_handlerOutput handler to be installed
Returns
RCL_RET_OK if successful, or
RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or
RCL_RET_BAD_ALLOC if allocating memory failed, or
RCL_RET_ERROR if a general error occurs

◆ rcl_logging_fini()

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
Returns
RCL_RET_OK if successful.
RCL_RET_ERROR if a general error occurs

◆ rcl_logging_rosout_enabled()

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
Returns
TRUE if logging rosout is enabled, or
FALSE if logging rosout is disabled.

◆ rcl_logging_multiple_output_handler()

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
Parameters
[in]locationThe pointer to the location struct or NULL
[in]severityThe severity level
[in]nameThe name of the logger, must be null terminated c string
[in]timestampThe timestamp for when the log message was made
[in]formatThe list of arguments to insert into the formatted log message
[in]argsargument for the string format