15 #ifndef RCLCPP__LOGGER_HPP_
16 #define RCLCPP__LOGGER_HPP_
23 #include "rclcpp/visibility_control.hpp"
26 #include "rcutils/logging.h"
27 #include "rcpputils/filesystem_helper.hpp"
39 #ifndef RCLCPP_LOGGING_ENABLED
40 #define RCLCPP_LOGGING_ENABLED 1
47 namespace node_interfaces
99 Unset = RCUTILS_LOG_SEVERITY_UNSET,
100 Debug = RCUTILS_LOG_SEVERITY_DEBUG,
101 Info = RCUTILS_LOG_SEVERITY_INFO,
102 Warn = RCUTILS_LOG_SEVERITY_WARN,
103 Error = RCUTILS_LOG_SEVERITY_ERROR,
104 Fatal = RCUTILS_LOG_SEVERITY_FATAL,
109 friend ::rclcpp::node_interfaces::NodeLogging;
123 explicit Logger(
const std::string & name)
124 : name_(new std::string(name)) {}
126 std::shared_ptr<const std::string> name_;
127 std::shared_ptr<std::pair<std::string, std::string>> logger_sublogger_pairname_ =
nullptr;
143 return name_->c_str();
RCLCPP_PUBLIC void set_level(Level level)
Set level for current logger.
RCLCPP_PUBLIC Logger get_child(const std::string &suffix)
Return a logger that is a descendant of this logger.
RCLCPP_PUBLIC const char * get_name() const
Get the name of this logger.
RCLCPP_PUBLIC Level get_effective_level() const
Get effective level for current logger.
Level
An enum for the type of logger level.
@ Info
The info log level.
@ Warn
The warn log level.
@ Fatal
The fatal log level.
@ Error
The error log level.
@ Debug
The debug log level.
@ Unset
The unset log level.
Versions of rosidl_typesupport_cpp::get_message_type_support_handle that handle adapted types.
RCLCPP_PUBLIC Logger get_node_logger(const rcl_node_t *node)
Return a named logger using an rcl_node_t.
RCLCPP_PUBLIC std::filesystem::path get_log_directory()
Get the current logging directory.
RCLCPP_PUBLIC Logger get_logger(const std::string &name)
Return a named logger.
Structure which encapsulates a ROS Node.