VLink 2.0.0
A high-performance communication middleware
Loading...
Searching...
No Matches
vlink::LoggerPluginInterface Class Referenceabstract

Pure-virtual interface for a custom logger backend loaded as a dynamic plugin. More...

#include <logger_plugin_interface.h>

Collaboration diagram for vlink::LoggerPluginInterface:

Public Member Functions

virtual bool init (std::string_view app_name)=0
 Initialises the logger backend for the given application name.
virtual bool log (int level, std::string_view str)=0
 Writes a single log entry to the backend.

Protected Member Functions

 LoggerPluginInterface ()=default
virtual ~LoggerPluginInterface ()=default

Detailed Description

Pure-virtual interface for a custom logger backend loaded as a dynamic plugin.

Concrete implementations are loaded at runtime by Plugin::load<LoggerPluginInterface>(). The VLINK_PLUGIN_REGISTER macro inside the class body wires up the factory/destroy functions that Plugin uses to manage the lifetime of the plugin instance.

Constructor & Destructor Documentation

◆ LoggerPluginInterface()

vlink::LoggerPluginInterface::LoggerPluginInterface ( )
protecteddefault
Here is the caller graph for this function:

◆ ~LoggerPluginInterface()

virtual vlink::LoggerPluginInterface::~LoggerPluginInterface ( )
protectedvirtualdefault

Member Function Documentation

◆ init()

virtual bool vlink::LoggerPluginInterface::init ( std::string_view app_name)
pure virtual

Initialises the logger backend for the given application name.

Called once by the host application after the plugin is loaded. The app_name string may be used to label log entries or configure a log file path.

Parameters
app_nameName of the calling application.
Returns
true on success; false if initialisation failed and the plugin should not be used.

◆ log()

virtual bool vlink::LoggerPluginInterface::log ( int level,
std::string_view str )
pure virtual

Writes a single log entry to the backend.

Called from vlink::Logger internals whenever a log message passes the current log level filter. Implementations should be non-blocking to avoid stalling the caller thread.

Parameters
levelLog severity level. Corresponds to vlink::Logger::Level values (e.g., kDebug, kInfo, kWarn, kError).
strThe fully-formatted log message string.
Returns
true if the message was written successfully; false on error.
Here is the call graph for this function:

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