|
VLink
2.3.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 records accepted by the Logger file-channel level 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 |
flush | host -> plugin | Drains records accepted before the call |
| 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) * flush() ----------> drain accepted records * Plugin destroy ----------> destroy instance *
level mirrors vlink::Logger::Level values. All hooks are non-throwing plugin boundaries.