Skip to content

Various cleanups in the logging code#370

Merged
clalancette merged 12 commits intorollingfrom
clalancette/logging-cleanup
Aug 10, 2022
Merged

Various cleanups in the logging code#370
clalancette merged 12 commits intorollingfrom
clalancette/logging-cleanup

Conversation

@clalancette
Copy link
Copy Markdown
Contributor

This PR, by itself, just does a bunch of minor cleanup in the logging code. Besides code cleanliness, the main reason to put this in is to facilitate a further optimization in the rcutils logging infrastructure, which I'll open up after this one is in.

The changes in this PR generally revolve around making the code easier to read, removing unnecessary infrastructure, and generally just cleaning things up. For review, it is easiest to review this PR patch-by-patch, as each one does a targeted thing. If necessary, I can open up separate PRs for each one, but that seemed....tedious :).

This just restricts their scope a bit.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Make it return early when possible to avoid indentation.
No functional change.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
In particular, don't set g_rcutils_logging_initialized to true
if we failed to initialize the string map.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Make it so that we don't set erroneous return values that we'll
never use.  Also simplify the code a bit

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Exit early if we get an error with it.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
This just restricts their visibility a bit.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
_s for the structure, and _t for the typedef.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
This can just be inline code.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
We had some of the infrastructure in place to run tests with
different RMWs, but we were never using it.  Additionally, it
doesn't make a huge amount of sense to use different RMWs
at the rcutils test layer; it is below the RMW.  Just remove
the infrastructure.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
This is just a thin wrapper around ament_add_{gtest,gmock},
so just use that.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
These are only needed in the header files.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
If we make it to the end of the function, it is always a success.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Copy link
Copy Markdown
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@clalancette
Copy link
Copy Markdown
Contributor Author

Full CI (since this is such a low-level change):

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@clalancette
Copy link
Copy Markdown
Contributor Author

Since this is all green, going ahead and merging. Thanks for the review!

@clalancette clalancette merged commit c1623e7 into rolling Aug 10, 2022
@delete-merged-branch delete-merged-branch bot deleted the clalancette/logging-cleanup branch August 10, 2022 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants