class final
RosLoggerFactoryRosLoggerFactory implements the factory you should use to enable the sink using ros.
The ROS logger can be easily used as follows
#include <BipedalLocomotion/TextLogging/Logger.h> #include <BipedalLocomotion/TextLogging/RosLogger.h> #include <BipedalLocomotion/TextLogging/LoggerBuilder.h> // Change the logger BipedalLocomotion::TextLogging::LoggerBuilder::setFactory(std::make_shared<BipedalLocomotion::TextLogging::RosLoggerFactory>())); BipedalLocomotion::log()->info("My info");
Base classes
- class LoggerFactory
- LoggerFactory is an interface that implements the factory paradigm.
Constructors, destructors, conversion operators
- RosLoggerFactory(const std::string_view& name = "blf")
- Construct a new RosLoggerFactory object.
- RosLoggerFactory(const rclcpp::Logger& logger)
- Construct a new RosLoggerFactory object.
Public functions
- auto createLogger() -> std::shared_ptr<TextLogging::Logger> const final
- Create the ROSLogger as a singleton.
Function documentation
BipedalLocomotion:: TextLogging:: RosLoggerFactory:: RosLoggerFactory(const std::string_view& name = "blf")
Construct a new RosLoggerFactory object.
Parameters | |
---|---|
name | the name of the logger which will be used inside the formatted messages |
std::shared_ptr<TextLogging::Logger> const BipedalLocomotion:: TextLogging:: RosLoggerFactory:: createLogger() final
Create the ROSLogger as a singleton.
Returns | the pointer to TextLogging::Logger that streams the output using ROS |
---|