File tree Expand file tree Collapse file tree
include/rclcpp/node_interfaces
src/rclcpp/node_interfaces Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,6 +55,11 @@ class NodeBase : public NodeBaseInterface
5555 const char *
5656 get_namespace () const ;
5757
58+ RCLCPP_PUBLIC
59+ virtual
60+ const char *
61+ get_logger_name () const ;
62+
5863 RCLCPP_PUBLIC
5964 virtual
6065 rclcpp::Context::SharedPtr
Original file line number Diff line number Diff line change @@ -52,6 +52,13 @@ class NodeBaseInterface
5252 const char *
5353 get_namespace () const = 0 ;
5454
55+ // / Return the logger name associated with the node.
56+ /* * \return The namespace of the node. */
57+ RCLCPP_PUBLIC
58+ virtual
59+ const char *
60+ get_logger_name () const = 0 ;
61+
5562 // / Return the context of the node.
5663 /* * \return SharedPtr to the node's context. */
5764 RCLCPP_PUBLIC
Original file line number Diff line number Diff line change @@ -185,6 +185,12 @@ NodeBase::get_namespace() const
185185 return rcl_node_get_namespace (node_handle_.get ());
186186}
187187
188+ const char *
189+ NodeBase::get_logger_name () const
190+ {
191+ return rcl_node_get_logger_name (node_handle_.get ());
192+ }
193+
188194rclcpp::Context::SharedPtr
189195NodeBase::get_context ()
190196{
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ using rclcpp::node_interfaces::NodeLogging;
1919NodeLogging::NodeLogging (rclcpp::node_interfaces::NodeBaseInterface * node_base)
2020: node_base_(node_base)
2121{
22- logger_ = rclcpp::get_logger (rcl_node_get_logger_name (node_base_-> get_rcl_node_handle () ));
22+ logger_ = rclcpp::get_logger (node_base-> get_logger_name ( ));
2323}
2424
2525NodeLogging::~NodeLogging ()
You can’t perform that action at this time.
0 commit comments