Document changes to rclcpp's logging macros (#949)#1220
Merged
clalancette merged 1 commit intoros2:rollingfrom Mar 11, 2021
audrow:audrow/reintroduce-logging-change
Merged
Document changes to rclcpp's logging macros (#949)#1220clalancette merged 1 commit intoros2:rollingfrom audrow:audrow/reintroduce-logging-change
clalancette merged 1 commit intoros2:rollingfrom
audrow:audrow/reintroduce-logging-change
Conversation
* Add changes to rclcpp's logging macros Signed-off-by: Audrow Nash <audrow.nash@gmail.com> * Apply suggestions from code review Signed-off-by: Audrow Nash <audrow.nash@gmail.com> Co-authored-by: Chris Lalancette <clalancette@openrobotics.org> * Fix syntax error by adding an escape character after ticks Signed-off-by: Audrow Nash <audrow.nash@gmail.com> * Update examples Signed-off-by: Audrow Nash <audrow.nash@gmail.com> * Make string examples clearer Signed-off-by: Audrow Nash <audrow.nash@gmail.com> * Replace second string example with a note Signed-off-by: Audrow Nash <audrow.nash@gmail.com> Co-authored-by: Chris Lalancette <clalancette@openrobotics.org>
clalancette
approved these changes
Mar 11, 2021
Contributor
clalancette
left a comment
There was a problem hiding this comment.
@audrow Apologies, somehow this got missed in the conversion from the master -> rolling branch.
Contributor
|
@Mergifyio backport foxy dashing |
Contributor
|
Command
|
clalancette
pushed a commit
that referenced
this pull request
Mar 11, 2021
* Add changes to rclcpp's logging macros Signed-off-by: Audrow Nash <audrow.nash@gmail.com> Co-authored-by: Chris Lalancette <clalancette@openrobotics.org> (cherry picked from commit 15eb141) Co-authored-by: Audrow Nash <audrow.nash@gmail.com>
clalancette
pushed a commit
that referenced
this pull request
Mar 11, 2021
* Add changes to rclcpp's logging macros Signed-off-by: Audrow Nash <audrow.nash@gmail.com> Co-authored-by: Chris Lalancette <clalancette@openrobotics.org> (cherry picked from commit 15eb141) Co-authored-by: Audrow Nash <audrow.nash@gmail.com>
jacobperron
reviewed
Mar 12, 2021
Comment on lines
+185
to
+186
| std::string my_std_string = "Foo"; | ||
| RCLCPP_DEBUG(get_logger(), "%s", my_std_string.c_str()); |
Member
There was a problem hiding this comment.
I hit this issue in some packages, and while updating I found that I could put the c-string directly as the first argument, e.g.
std::string my_std_string = "Foo";
RCLCPP_DEBUG(get_logger(), my_std_string.c_str());Is this expected, or should I not do this for security reasons? If it's the latter, then is there a way we can enforce this?
Contributor
There was a problem hiding this comment.
You should not do it for security reasons. If you enable -Wformat=2 on your package, you'll get a warning about that line of code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I noticed that this change wasn't brought into the rolling branch from master after #949.
It might be the case that other changes were omitted in moving off of master.