|
VLink
2.0.0
A high-performance communication middleware
|
Abstract contract for shared-library logger backends loaded via the VLink Plugin system.
更多...
类 | |
| class | vlink::LoggerPluginInterface |
| Pure-virtual interface that every shared-library logger backend implements. 更多... | |
命名空间 | |
| vlink | |
Abstract contract for shared-library logger backends loaded via the VLink Plugin system.
A logger plugin is a shared library that exports a factory through VLINK_PLUGIN_DECLARE and embeds VLINK_PLUGIN_REGISTER inside its concrete subclass. At runtime the host application uses vlink::Plugin::load<LoggerPluginInterface> to construct an instance and forwards every log record to its log method.
| Hook | Direction | Contract |
|---|---|---|
VLINK_PLUGIN_REGISTER | inside the class | Injects get_plugin_id() (ID = demangled name) |
VLINK_PLUGIN_DECLARE | translation unit | Exposes the factory and the version metadata |
init | host -> plugin | Called once after construction with the app name |
log | host -> plugin | Called per record after passing level filters |
| Destructor | host -> plugin | Called when the host releases the plugin handle |
* host plugin * ---- ------ * Plugin::load<...> ----------> factory creates instance * init(app_name) ----------> initialise backend * log(level, msg) ----------> forward to backend (repeated) * Plugin destroy ----------> destroy instance *
level mirrors vlink::Logger::Level values. Both methods must avoid throwing across the plugin boundary; thrown exceptions there cause undefined behaviour.