VLink 2.0.0
A high-performance communication middleware
载入中...
搜索中...
未找到
vlink::LoggerPluginInterface类 参考abstract

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

#include <logger_plugin_interface.h>

vlink::LoggerPluginInterface 的协作图:

Public 成员函数

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 成员函数

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

详细描述

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.

构造及析构函数说明

◆ LoggerPluginInterface()

vlink::LoggerPluginInterface::LoggerPluginInterface ( )
protecteddefault
这是这个函数的调用关系图:

◆ ~LoggerPluginInterface()

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

成员函数说明

◆ 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.

参数
app_nameName of the calling application.
返回
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.

参数
levelLog severity level. Corresponds to vlink::Logger::Level values (e.g., kDebug, kInfo, kWarn, kError).
strThe fully-formatted log message string.
返回
true if the message was written successfully; false on error.
函数调用图:

该类的文档由以下文件生成: