Skip to content

Commit

Permalink
Adding duplicate node information
Browse files Browse the repository at this point in the history
Signed-off-by: CursedRock17 <[email protected]>

fixing some style changes

Signed-off-by: CursedRock17 <[email protected]>

Adding heap arrays

Signed-off-by: CursedRock17 <[email protected]>

Removing extra bulk

Signed-off-by: CursedRock17 <[email protected]>

Update rcl/src/rcl/logging_rosout.c

Co-authored-by: Chen Lihui <[email protected]>
  • Loading branch information
CursedRock17 and Chen Lihui committed Aug 18, 2023
1 parent b55c41b commit 28dd963
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions rcl/src/rcl/logging_rosout.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "rcl/logging_rosout.h"

#include "rcl/allocator.h"
#include "rcl/error_handling.h"
#include "rcl/logging_rosout.h"
#include "rcl/node.h"
#include "rcl/publisher.h"
#include "rcl/time.h"
Expand Down Expand Up @@ -250,13 +251,19 @@ rcl_ret_t rcl_logging_rosout_init_publisher_for_node(rcl_node_t * node)
if (rcutils_hash_map_key_exists(&__logger_map, &logger_name)) {
// @TODO(nburek) Update behavior to either enforce unique names or work with non-unique
// names based on the outcome here: https://github.com/ros2/design/issues/187
const char * node_name = rcl_node_get_name(node);
if (NULL == node_name) {
RCL_SET_ERROR_MSG("Node name was null.");
return RCL_RET_ERROR;
}

RCUTILS_LOG_WARN_NAMED(
"rcl.logging_rosout",
"Publisher already registered for provided node name. If this is due to multiple nodes "
"with the same name then all logs for that logger name will go out over the existing "
"publisher. As soon as any node with that name is destructed it will unregister the "
"publisher, preventing any further logs for that name from being published on the rosout "
"topic.");
"Publisher already registered for: '%s'. If this is due to multiple nodes with the same name "
"then all logs for: '%s' will go out over the existing publisher. As soon as any "
"node with that name is destructed it will unregister the publisher, preventing "
"any further logs for that name from being published on the rosout topic.",
node_name, logger_name);
return RCL_RET_OK;
}

Expand Down

0 comments on commit 28dd963

Please sign in to comment.