BipedalLocomotion::TextLogging::YarpLoggerFactory class final

YarpLoggerFactory implements the factory you should use to enable the sink using yaro.

The YARP logger can be easily used as follows

#include <BipedalLocomotion/TextLogging/Logger.h>
#include <BipedalLocomotion/TextLogging/YarpLogger.h>
#include <BipedalLocomotion/TextLogging/LoggerBuilder.h>

// Change the logger
BipedalLocomotion::TextLogging::LoggerBuilder::setFactory(std::make_shared<BipedalLocomotion::TextLogging::YarpLoggerFactory>()));

BipedalLocomotion::log()->info("My info");

Base classes

class LoggerFactory
LoggerFactory is an interface that implements the factory paradigm.

Constructors, destructors, conversion operators

YarpLoggerFactory(const std::string_view& name = "blf")
Construct a new YarpLoggerFactory object.

Public functions

auto createLogger() -> std::shared_ptr<TextLogging::Logger> const final
Create the YARPLogger as a singleton.

Function documentation

BipedalLocomotion::TextLogging::YarpLoggerFactory::YarpLoggerFactory(const std::string_view& name = "blf")

Construct a new YarpLoggerFactory object.

Parameters
name the name of the logger which will be used inside the formatted messages

std::shared_ptr<TextLogging::Logger> const BipedalLocomotion::TextLogging::YarpLoggerFactory::createLogger() final

Create the YARPLogger as a singleton.

Returns the pointer to TextLogging::Logger that streams the output using YARP