ROS 2 rclcpp + rcl - humble
humble
ROS 2 C++ Client Library with ROS Client Library
|
Public Types | |
enum class | Level { Unset = RCUTILS_LOG_SEVERITY_UNSET , Debug = RCUTILS_LOG_SEVERITY_DEBUG , Info = RCUTILS_LOG_SEVERITY_INFO , Warn = RCUTILS_LOG_SEVERITY_WARN , Error = RCUTILS_LOG_SEVERITY_ERROR , Fatal = RCUTILS_LOG_SEVERITY_FATAL } |
An enum for the type of logger level. More... | |
Public Member Functions | |
RCLCPP_PUBLIC | Logger (const Logger &)=default |
RCLCPP_PUBLIC const char * | get_name () const |
Get the name of this logger. More... | |
RCLCPP_PUBLIC Logger | get_child (const std::string &suffix) |
Return a logger that is a descendant of this logger. More... | |
RCLCPP_PUBLIC void | set_level (Level level) |
Set level for current logger. More... | |
Friends | |
Logger | rclcpp::get_logger (const std::string &name) |
Definition at line 91 of file logger.hpp.
|
strong |
An enum for the type of logger level.
Enumerator | |
---|---|
Unset | The unset log level. |
Debug | The debug log level. |
Info | The info log level. |
Warn | The warn log level. |
Error | The error log level. |
Fatal | The fatal log level. |
Definition at line 95 of file logger.hpp.
|
inline |
Return a logger that is a descendant of this logger.
The child logger's full name will include any hierarchy conventions that indicate it is a descendant of this logger. For example, get_logger('abc').get_child('def')
will return a logger with name abc.def
.
[in] | suffix | the child logger's suffix |
Definition at line 160 of file logger.hpp.
Referenced by rclcpp::PublisherBase::PublisherBase(), and rclcpp::SubscriptionBase::SubscriptionBase().
|
inline |
Get the name of this logger.
nullptr
if this logger is invalid (e.g. because logging is disabled). Definition at line 138 of file logger.hpp.
Referenced by set_level().
void rclcpp::Logger::set_level | ( | Level | level | ) |
Set level for current logger.
[in] | level | the logger's level |
rclcpp::exceptions::RCLInvalidArgument | if level is invalid. |
rclcpp::exceptions::RCLError | if other error happens. |
Definition at line 66 of file logger.cpp.
References get_name(), RCL_RET_ERROR, and RCL_RET_INVALID_ARGUMENT.