class
LoggerBuilderLoggerBuilder is a class that implements the Builder paradigm.
You can use the LoggerBuilder at the beginning of your application to set a different sink for spdlog. For instance, you can use the following example to enable the TextLogging with YARP
#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");
Public static functions
- static auto setFactory(std::shared_ptr<LoggerFactory> factory) -> bool
- Set a custom factory.
Friends
- auto BipedalLocomotion::log() -> std::shared_ptr<Logger>const
Function documentation
static bool BipedalLocomotion:: TextLogging:: LoggerBuilder:: setFactory(std::shared_ptr<LoggerFactory> factory)
Set a custom factory.
Returns | True in case success, false otherwise. |
---|