|
Toast Engine
|
Static Public Member Functions | |
| static auto | create () noexcept -> std::unique_ptr< Logger > |
| Set up the global logger instance, gives ownership to the caller. | |
| static void | log (std::string_view file, unsigned line, char severity, std::string_view sink, std::string_view message) |
| Entry point for all engine logs. | |
|
staticnoexcept |
Set up the global logger instance, gives ownership to the caller.
|
static |
Entry point for all engine logs.
Thread-safe. It pushes the log to a local queue and signals a background task to handle the actual network I/O

| std::atomic<bool> logging::Logger::drain_pending = false |
Prevents multiple background jobs from fighting over the same socket.
We use an atomic flag to ensure only one 'drain' job is scheduled at a time, avoiding unnecessary context switches and thread contention.