|
opm-simulators
|
RAII guard that owns a DeferredLogger and auto-gathers on destruction. More...
#include <GroupStateHelper.hpp>
Public Member Functions | |
| ScopedLoggerGuard (const GroupStateHelper &helper, bool do_mpi_gather=true) | |
| Constructor for scoped logger guard. | |
| ScopedLoggerGuard (const ScopedLoggerGuard &)=delete | |
| ScopedLoggerGuard & | operator= (const ScopedLoggerGuard &)=delete |
| ScopedLoggerGuard & | operator= (ScopedLoggerGuard &&)=delete |
| ScopedLoggerGuard (ScopedLoggerGuard &&other) noexcept | |
RAII guard that owns a DeferredLogger and auto-gathers on destruction.
This class provides a complete lifecycle for deferred logging in parallel simulations. It owns a DeferredLogger instance and automatically handles:
Usage: auto guard = groupStateHelper.pushLogger(); // Use groupStateHelper.deferredLogger() to log messages // On scope exit: gather, log (if terminal), restore previous logger
|
inlineexplicit |
Constructor for scoped logger guard.
| helper | Reference to the GroupStateHelper |
| do_mpi_gather | If true, gather messages across MPI ranks on destruction. Set to false when called from contexts where MPI synchronization is not possible (e.g., NLDD domain-local operations). |