24template <
typename LogSink = sinks::ConsoleLogSink,
typename EventVariant = DefaultEvents, std::
size_t MaxMessageSize = 256>
30 : _logger(category, minLevel, std::move(
sink))
38 template <
typename... Args>
39 void info(
const char* fmt, Args&&... args)
const
41 _logger.
info(fmt, std::forward<Args>(args)...);
45 void run(
const std::stop_token& stopToken)
47 _logger.
info(
"Asynchronous LogBackgroundService started.");
48 while (!stopToken.stop_requested()) {
49 std::this_thread::sleep_for(std::chrono::milliseconds(100));
51 _logger.
info(
"Asynchronous LogBackgroundService stopping.");
Managed worker thread using C++20 std::jthread and std::stop_token.
Static logger frontend with compile-time formatting and severity filtering.
Multi-threaded background worker service owning a dedicated std::jthread. Integrates incoming event q...
Definition BackgroundService.hpp:35
EventSinkT< EventVariant > sink() noexcept
Get an EventSink handle targeting this service's incoming event queue.
Definition Service.hpp:62
Asynchronous background logging service executing on a dedicated C++20 std::jthread....
Definition LogBackgroundService.hpp:25
void info(const char *fmt, Args &&... args) const
Log background heartbeat or event message.
Definition LogBackgroundService.hpp:39
LogBackgroundService(const char *category="LogService", LogLevel minLevel=LogLevel::Info, LogSink sink=LogSink{})
Definition LogBackgroundService.hpp:29
void run(const std::stop_token &stopToken)
Main background execution loop.
Definition LogBackgroundService.hpp:45
LoggerT< LogSink, MaxMessageSize > LoggerType
Definition LogBackgroundService.hpp:27
const LoggerType & logger() const noexcept
Definition LogBackgroundService.hpp:35
LoggerType & logger() noexcept
Access embedded logger instance.
Definition LogBackgroundService.hpp:34
Static compile-time logger wrapper managing severity level filtering and zero-heap string formatting.
Definition Logger.hpp:24
void info(const char *fmt, Args &&... args) const
Definition Logger.hpp:115
Definition LogBackgroundService.hpp:17
LogLevel
Logging severity levels.
Definition LogLevel.hpp:14