Function rcutils_log

Function Documentation

void rcutils_log(const rcutils_log_location_t *location, int severity, const char *name, const char *format, ...)

Log a message.

The attributes of this function are influenced by the currently set output handler.

Attribute

Adherence

Allocates Memory

No, for formatted outputs <= 1023 characters

| Yes, for formatted outputs >= 1024 characters Thread-Safe | Yes, with itself [1] Uses Atomics | No Lock-Free | Yes [1] should be thread-safe with itself but not with other logging functions

This should be thread-safe with itself, but is not thread-safe with other logging functions that do things like set logger levels.

Todo:

There are no thread-safety gurantees between this function and other logging functions in rcutils, even though it is likely users are calling them concurrently today. We need to revisit these functions with respect to this issue and make guarantees where we can, and change functions higher in the stack to provide the thread-safety where we cannot.

Parameters:
  • location[in] The pointer to the location struct or NULL

  • severity[in] The severity level

  • name[in] The name of the logger, must be null terminated c string or NULL

  • format[in] The format string

  • ...[in] The variable arguments