Base class to allow Behaviors to report messages with detailed explanations to MoveIt Studio UI.
More...
#include <logger.hpp>
|
virtual | ~LoggerBase ()=default |
|
virtual void | publishFailureMessage (const std::string &error_source_name, const std::string &details="") |
| Helper function that wraps publishMessage with a preset ERROR log level.
|
|
virtual void | publishWarnMessage (const std::string &source_name, const std::string &details="") |
| Helper function that wraps publishMessage with a preset WARN log level.
|
|
virtual void | publishInfoMessage (const std::string &source_name, const std::string &details="") |
| Helper function that wraps publishMessage with a preset INFO log level.
|
|
virtual void | publishMessage (const int32_t log_level, const std::string &details) |
| Function to publish a message. The default implementation logs to spdlog. LoggerROS is a good example of a subclass that overrides this, in which it publishes the message to a ROS topic and also calls this superclass function to also log to console.
|
|
virtual std::string | consumeErrorLogBuffer () |
| Helper function to get the error log buffer.
|
|
Base class to allow Behaviors to report messages with detailed explanations to MoveIt Studio UI.
◆ ~LoggerBase()
virtual moveit_studio::behavior::LoggerBase::~LoggerBase |
( |
| ) |
|
|
virtualdefault |
◆ consumeErrorLogBuffer()
std::string moveit_studio::behavior::LoggerBase::consumeErrorLogBuffer |
( |
| ) |
|
|
virtual |
Helper function to get the error log buffer.
- Returns
- A string containing all the error logs in the buffer, separated by new lines
- Note
- This function clears out the logs once retrieved
◆ publishFailureMessage()
void moveit_studio::behavior::LoggerBase::publishFailureMessage |
( |
const std::string & |
error_source_name, |
|
|
const std::string & |
details = "" |
|
) |
| |
|
virtual |
Helper function that wraps publishMessage with a preset ERROR log level.
- Parameters
-
error_source_name | Name used to identify the source of the failure. |
details | A detailed message describing the failure. For example, the contents of an exception's message. |
◆ publishInfoMessage()
void moveit_studio::behavior::LoggerBase::publishInfoMessage |
( |
const std::string & |
source_name, |
|
|
const std::string & |
details = "" |
|
) |
| |
|
virtual |
Helper function that wraps publishMessage with a preset INFO log level.
- Parameters
-
source_name | Name used to identify the source of the info. |
details | A detailed message describing the information. |
◆ publishMessage()
void moveit_studio::behavior::LoggerBase::publishMessage |
( |
const int32_t |
log_level, |
|
|
const std::string & |
details |
|
) |
| |
|
virtual |
Function to publish a message. The default implementation logs to spdlog. LoggerROS is a good example of a subclass that overrides this, in which it publishes the message to a ROS topic and also calls this superclass function to also log to console.
- Parameters
-
log_level | moveit_studio_agent_msgs::msg::ERROR/WARN/INFO |
details | Contains the information message |
Reimplemented in moveit_studio::behavior::LoggerROS.
◆ publishWarnMessage()
void moveit_studio::behavior::LoggerBase::publishWarnMessage |
( |
const std::string & |
source_name, |
|
|
const std::string & |
details = "" |
|
) |
| |
|
virtual |
Helper function that wraps publishMessage with a preset WARN log level.
- Parameters
-
source_name | Name used to identify the source of the warning. |
details | A detailed message describing the warning. |
The documentation for this class was generated from the following files: