Function rcutils_logging_format_message

Function Documentation

rcutils_ret_t rcutils_logging_format_message(const rcutils_log_location_t *location, int severity, const char *name, rcutils_time_point_value_t timestamp, const char *msg, rcutils_char_array_t *logging_output)

Formats a log message according to RCUTILS_CONSOLE_OUTPUT_FORMAT.

A formatter that is meant to be used by an output handler to format a log message to the match the format specified in RCUTILS_CONSOLE_OUTPUT_FORMAT by performing token replacement.

Attribute

Adherence

Allocates Memory

Yes

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

Parameters:
  • location[in] The location information about where the log came from

  • severity[in] The severity of the log message expressed as an integer

  • name[in] The name of the logger that this message came from

  • timestamp[in] The time at which the log message was generated

  • msg[in] The message being logged

  • logging_output[out] An output buffer for the formatted message

Returns:

RCUTILS_RET_OK if successful.

Returns:

RCUTILS_RET_BAD_ALLOC if memory allocation error occured