Class Logger
Defined in File logger.hpp
Class Documentation
-
class Logger
Public Types
Public Functions
-
inline const char *get_name() const
Get the name of this logger.
- Returns:
the full name of the logger including any prefixes, or
- Returns:
nullptr
if this logger is invalid (e.g. because logging is disabled).
-
inline Logger get_child(const std::string &suffix)
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 nameabc.def
.- Parameters:
suffix – [in] the child logger’s suffix
- Returns:
a logger with the fully-qualified name including the suffix, or
- Returns:
a dummy logger if this logger is invalid (e.g. because logging is disabled).
-
void set_level(Level level)
Set level for current logger.
- Parameters:
level – [in] the logger’s level
- Throws:
rclcpp::exceptions::RCLInvalidArgument – if level is invalid.
rclcpp::exceptions::RCLError – if other error happens.
-
inline const char *get_name() const