Skip to content

Commit 69b094e

Browse files
authored
add RCUTILS_LOGGING_AUTOINIT_WITH_ALLOCATOR. (#415)
Signed-off-by: Tomoya Fujita <[email protected]>
1 parent 16e6bfd commit 69b094e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

include/rcutils/logging.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,9 +558,18 @@ void rcutils_logging_console_output_handler(
558558
* All logging macros ensure that this has been called once.
559559
*/
560560
#define RCUTILS_LOGGING_AUTOINIT \
561+
RCUTILS_LOGGING_AUTOINIT_WITH_ALLOCATOR(rcutils_get_default_allocator())
562+
563+
/**
564+
* \def RCUTILS_LOGGING_AUTOINIT_WITH_ALLOCATOR
565+
* \brief Initialize the rcl logging library with allocator.
566+
* Usually it is unnecessary to call the macro directly.
567+
* All logging macros ensure that this has been called once.
568+
*/
569+
#define RCUTILS_LOGGING_AUTOINIT_WITH_ALLOCATOR(alloc) \
561570
do { \
562571
if (RCUTILS_UNLIKELY(!g_rcutils_logging_initialized)) { \
563-
if (rcutils_logging_initialize() != RCUTILS_RET_OK) { \
572+
if (rcutils_logging_initialize_with_allocator(alloc) != RCUTILS_RET_OK) { \
564573
RCUTILS_SAFE_FWRITE_TO_STDERR( \
565574
"[rcutils|" __FILE__ ":" RCUTILS_STRINGIFY(__LINE__) \
566575
"] error initializing logging: "); \

0 commit comments

Comments
 (0)