1 parent
4fca5523f6
commit
fa30098129
5 files changed
+59
No files matched your search
@@ -3,6 +3,8 @@
|
||||
#include <Void/Log/Log.hpp>
|
||||
#include <Void/Log/Logger.hpp>
|
||||
|
||||
#include <memory>
|
||||
|
||||
// Bridge between Void::Log (the thin emission layer used by all modules) and
|
||||
// Void::Logging::Logger (the full sink implementation).
|
||||
//
|
||||
@@ -69,4 +71,23 @@ namespace Void::Log
|
||||
};
|
||||
}
|
||||
|
||||
/// Owning variant for process-global sinks. The logger remains alive until
|
||||
/// this sink is replaced or the logging state is destroyed.
|
||||
[[nodiscard]] inline Sink
|
||||
make_sink(std::shared_ptr<Void::Logging::Logger> logger)
|
||||
{
|
||||
return [logger = std::move(logger)](
|
||||
Level level, std::string_view module, std::string_view message,
|
||||
const std::source_location& location) {
|
||||
if (!logger) {
|
||||
return;
|
||||
}
|
||||
auto full = std::string{"["};
|
||||
full += module;
|
||||
full += "] ";
|
||||
full += message;
|
||||
logger->log(to_logging_level(level), full, location);
|
||||
};
|
||||
}
|
||||
|
||||
} // namespace Void::Log
|
||||
@@ -86,6 +86,9 @@ namespace Void::Plugin
|
||||
// name argument is the registry name (IPlugin::name()).
|
||||
std::function<std::string(std::string_view plugin_name)>
|
||||
config_provider;
|
||||
// Host-specific contract checked after plugin activation and before
|
||||
// publication. A failed validation aborts load/reload transactionally.
|
||||
std::function<bool(IPlugin&, const PluginInfo&)> instance_validator;
|
||||
};
|
||||
|
||||
// Identifies an on_reloaded observer for remove_on_reloaded.
|
||||
|
||||
Reference in new issue
Block a user