MoveIt Pro API
Core Behaviors for MoveIt Pro
Loading...
Searching...
No Matches
moveit_studio::behavior::LoggerBase Class Reference

Base class to allow Behaviors to report messages with detailed explanations to MoveIt Studio UI. More...

#include <logger.hpp>

Inheritance diagram for moveit_studio::behavior::LoggerBase:

Public Member Functions

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.
 

Detailed Description

Base class to allow Behaviors to report messages with detailed explanations to MoveIt Studio UI.

Constructor & Destructor Documentation

◆ ~LoggerBase()

virtual moveit_studio::behavior::LoggerBase::~LoggerBase ( )
virtualdefault

Member Function Documentation

◆ 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_nameName used to identify the source of the failure.
detailsA 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_nameName used to identify the source of the info.
detailsA 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_levelmoveit_studio_agent_msgs::msg::ERROR/WARN/INFO
detailsContains 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_nameName used to identify the source of the warning.
detailsA detailed message describing the warning.

The documentation for this class was generated from the following files: