Gromacs
2026.0-dev-20241121-c76fa1e
|
#include <gromacs/utility/include/gromacs/utility/logger.h>
Helper class for implementing GMX_LOG.
Public Member Functions | |
LogWriteHelper (ILogTarget *target) | |
Initializes a helper for writing to the given target. | |
operator bool () const | |
Returns whether anything needs to be written. More... | |
LogWriteHelper & | operator= (const LogEntryWriter &entryWriter) |
Writes the entry from the given writer to the log target. More... | |
|
inline |
Returns whether anything needs to be written.
Note that the return value is unintuitively false
when the target is active, to allow implementing GMX_LOG like it is now.
|
inline |
Writes the entry from the given writer to the log target.
This is implemented as an assignment operator to get proper precedence for operations for the GMX_LOG macro; this is a common technique for implementing macros that allow streming information to them (see, e.g., Google Test).