Repository navigation
refactor(gateway): log the HTTP layer through a ROS-free logging interface - #746
Merged
Merged
Conversation
mfaferek93
reviewed
Oct 23, 2026
mfaferek93
approved these changes
Oct 24, 2026
…rface Route the HTTP server, handlers, aggregation, plugins and script provider through a logging interface that does not depend on RCLCPP_* macros. The call site is passed to the log sink. The logic behind this layer can then be built and tested without ROS and without DDS setup.
A log call took a std::shared_ptr copy of the sink through std::atomic_load, which locks a mutex from a process-wide pool and changes the reference count, and the call to enabled() did it a second time. The slot now holds a std::atomic<Sink *> that the log path reads, and set_sink keeps every installed sink alive until the process exits, so a thread that is logging never uses a freed sink. Sink::enabled and Sink::write take the logger name as const std::string &, so the ROS sink passes c_str() to rcutils without building a string.
bburda
force-pushed
the
feat/gateway-core-1-logging
branch
from
October 24, 2026 11:33
f4926be to
e6b4fbc
Compare
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.
Pull Request
Summary
The HTTP server, the handlers, aggregation, plugins and the script provider log through a logging interface, with no
RCLCPP_*macros. The log sink gets the call site. Log lines keep their logger names.Issue
Type
Testing
./scripts/test.sh unit --packages-select ros2_medkit_gateway./scripts/test.sh test_rest_logger_nameschecks the logger names of the REST layer against a running gateway.Checklist