src/internal/config_diagnostics.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /** | ||
| 2 | * @file internal/config_diagnostics.cpp | ||
| 3 | * @brief Opens and drains the deferred diagnostic record list. | ||
| 4 | * @details internal/config_diagnostics.hpp owns the contract. | ||
| 5 | */ | ||
| 6 | |||
| 7 | #include "internal/config_diagnostics.hpp" | ||
| 8 | |||
| 9 | namespace DetourModKit::config::detail | ||
| 10 | { | ||
| 11 | 768 | DeferredDiagnostics open_deferred_diagnostics() noexcept | |
| 12 | { | ||
| 13 | 1536 | return DeferredDiagnostics{ | |
| 14 | 768 | .threshold = log().get_log_level(), | |
| 15 | .records = {}, | ||
| 16 | 768 | }; | |
| 17 | } | ||
| 18 | |||
| 19 | 1395 | void emit_deferred_diagnostics(DeferredDiagnostics &diags) noexcept | |
| 20 | { | ||
| 21 | 1395 | Logger &logger = log(); | |
| 22 |
2/2✓ Branch 18 → 5 taken 405 times.
✓ Branch 18 → 19 taken 1395 times.
|
3195 | for (const DeferredDiagnostic &record : diags.records) |
| 23 | { | ||
| 24 | 405 | (void)logger.log_noexcept(record.level, record.line); | |
| 25 | } | ||
| 26 | 1395 | diags.records.clear(); | |
| 27 | 1395 | } | |
| 28 | } // namespace DetourModKit::config::detail | ||
| 29 |