Skip to main content

LoggerROS Class

A ROS-specialized implementation of LoggerBase that publishes the error message on a topic and logs it through an rclcpp Logger. More...

Declaration

class moveit_pro::behavior::LoggerROS { ... }

Included Headers

#include <logger.hpp>

Base class

classLoggerBase

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

Public Constructors Index

LoggerROS (const std::shared_ptr< rclcpp::Node > &node)

Constructor for LoggerROS. More...

Public Member Functions Index

voidpublishMessage (const int32_t log_level, const std::string &details) override

Publishes message to ROS topic and logs to console. More...

voidpublishMessage (const int32_t log_level, const std::string &source_name, const std::string &details)

Function to publish a message. More...

voidpublishMessage (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. More...

Private Member Attributes Index

rclcpp::Publisher< moveit_studio_agent_msgs::msg::Log >::SharedPtrpublisher_

Publisher for the log topic. More...

Description

A ROS-specialized implementation of LoggerBase that publishes the error message on a topic and logs it through an rclcpp Logger.

Definition at line 207 of file logger.hpp.

Public Constructors

LoggerROS()

moveit_pro::behavior::LoggerROS::LoggerROS (const std::shared_ptr< rclcpp::Node > & node)
explicit

Constructor for LoggerROS.

Parameters
node

rclcpp Node used when creating the log publisher.

Declaration at line 217 of file logger.hpp, definition at line 184 of file logger.cpp.

Public Member Functions

publishMessage()

void moveit_pro::behavior::LoggerROS::publishMessage (const int32_t log_level, const std::string & details)
virtual

Publishes message to ROS topic and logs to console.

Parameters
log_level

moveit_studio_agent_msgs::msg::Log::ERROR/WARN/INFO/DEBUG

details

Contains the information message

Declaration at line 224 of file logger.hpp, definition at line 189 of file logger.cpp.

publishMessage()

void moveit_pro::behavior::LoggerBase::publishMessage (const int32_t log_level, const std::string & source_name, const std::string & details)

Function to publish a message.

Parameters
log_level

moveit_studio_agent_msgs::msg::Log::ERROR/WARN/INFO/DEBUG

source_name

Name used to identify the source of the log.

details

Contains the information message

Declaration at line 211 of file logger.hpp, definition at line 72 of file logger.cpp.

publishMessage()

void moveit_pro::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::Log::ERROR/WARN/INFO/DEBUG

details

Contains the information message

Declaration at line 211 of file logger.hpp, definition at line 136 of file logger.cpp.

Private Member Attributes

publisher_

rclcpp::Publisher<moveit_studio_agent_msgs::msg::Log>::SharedPtr moveit_pro::behavior::LoggerROS::publisher_

Publisher for the log topic.

Definition at line 230 of file logger.hpp.


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


Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.9.8.