Skip to content

fix: build RCLCPP_LOG_STREAM_EXPRESSION message if expression is true - #3460

Merged
ahcorde merged 2 commits into
ros2:rollingfrom
Nisarg236:lazy-stream-expression
Dec 1, 2026
Merged

ahcorde merged 2 commits into
ros2:rollingfrom
Nisarg236:lazy-stream-expression

Conversation

@Nisarg236

@Nisarg236 Nisarg236 commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Description

Because the expression may be something like

const bool has_value = maybe_something.has_value();
RCLCPP_INFO_STREAM_EXPRESSION(logger, has_value, "value: " << maybe_something.value());

This change checks the expression first and builds the stream only when it's true.

Is this user-facing behavior change?

No

Did you use Generative AI?

Yes but I instructed explicitly what to change and reviewed as well.

Signed-off-by: Nisarg <nisargnileshpanchal@gmail.com>
@Nisarg236
Nisarg236 marked this pull request as ready for review December 1, 2026 11:26
@Nisarg236 Nisarg236 changed the title Only build RCLCPP_LOG_STREAM_EXPRESSION message when expression is true fix: build RCLCPP_LOG_STREAM_EXPRESSION message if expression is true Dec 1, 2026
Signed-off-by: Nisarg <nisargnileshpanchal@gmail.com>
@jmachowinski

jmachowinski commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Pulls: #3460
Gist: https://gist.githubusercontent.com/jmachowinski/db11eb3d6ebaaf4eb370702e5f7492c2/raw/27ba30cffb8856c5ae39ae91ddaba6a6d4216d52/ros2.repos
BUILD args:
TEST args:
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/21421

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

@ahcorde
ahcorde merged commit 979ebaf into ros2:rolling Dec 1, 2026
2 of 3 checks passed
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.

3 participants