Conversation
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.
This code change is one step in the higher-level Logging feature, see: ros2/ros2#425 for others
This adds a
Loggerclass, thenode->get_logger()method, and therclcpp::get_logger(name)free function for non-node loggers.Logging macros must now have a logger object passed as the first argument (instead of a name as previously accepted). I added
rclcpp/rclcpp/resource/logging.hpp.em
Line 47 in ed590ad
The Logger class is based off a rough implementation initially by @wjwwood. The node's logger is implemented as an interface on @Karsten1987's suggestion to support the use case of composing a lightweight Node that does not include or "pay for" the logger interface. Additionally, even if using the logger interface, logging functionality can be minimised with the preprocessor directive
RCLCPP_LOGGING_ENABLEDset to false.Todo before merge:
Other todos listed in the code are planned as follow-up PRs.
ci windows