Skip to content

Commit

Permalink
Don't hard-code logger name separator
Browse files Browse the repository at this point in the history
  • Loading branch information
dhood committed Feb 22, 2018
1 parent 462e97f commit 05923fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rcl/src/rcl/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ const char * rcl_create_node_logger_name(
// i.e. it will start with a forward slash, which we want to ignore.
const char * ns_with_separators = rcutils_repl_str(
node_namespace + 1, // Ignore the leading forward slash.
"/", ".",
"/", RCUTILS_LOGGING_SEPARATOR_CHAR_ARRAY,
(rcl_allocator_t *)allocator); // TODO(dhood): remove need for casting away const
if (NULL == ns_with_separators) {
return NULL;
}

// Join the namespace and node name to create the logger name.
char * node_logger_name = rcutils_format_string(
*allocator, "%s.%s", ns_with_separators, node_name);
*allocator, "%s%s%s", ns_with_separators, RCUTILS_LOGGING_SEPARATOR_CHAR_ARRAY, node_name);
if (NULL == node_logger_name) {
allocator->deallocate((char *)ns_with_separators, allocator->state);
return NULL;
Expand Down

0 comments on commit 05923fa

Please sign in to comment.