Function rcl_logging_rosout_add_sublogger

Function Documentation

rcl_ret_t rcl_logging_rosout_add_sublogger(const char *logger_name, const char *sublogger_name)

Add a subordinate logger based on a logger.

Calling this will use the existing publisher of logger_name on a node to create an subordinate logger that will be used by the logging system to publish all log messages from that Node’s logger.

If a subordinate logger already exists, it will NOT be created.

It is expected that after creating a subordinate logger with this function rcl_logging_rosout_remove_sublogger() will be called for the node to cleanup the subordinate logger while the publisher of logger_name is still valid.

Attribute

Adherence

Allocates Memory

Yes

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

Parameters:
  • logger_name[in] a logger_name that has a corresponding rosout publisher on a node

  • sublogger_name[in] a sublogger name

Returns:

RCL_RET_OK if the subordinate logger was created successfully, or

Returns:

RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or

Returns:

#RCL_RET_SUBLOGGER_ALREADY_EXIST if the subordinate logger already exists, or

Returns:

RCL_RET_BAD_ALLOC if allocating memory failed, or

Returns:

RCL_RET_ERROR if an unspecified error occurs.