Gromacs
2025-dev-20241003-bd59e46
|
#include <gromacs/utility/include/gromacs/utility/loggerbuilder.h>
Initializes loggers.
This class provides methods for specifying logging targets for a logger and building the logger after all targets have been specified. Having this separate from the logger allows using different internal data structures during initialization and operation, and simplifies the responsibilities of the involved classes.
Public Member Functions | |
void | addTargetStream (MDLogger::LogLevel level, TextOutputStream *stream) |
Adds a stream to which log output is written. More... | |
void | addTargetFile (MDLogger::LogLevel level, FILE *fp) |
Adds a file to which log output is written. More... | |
LoggerOwner | build () |
Builds the logger with the targets set for this builder. More... | |
void gmx::LoggerBuilder::addTargetFile | ( | MDLogger::LogLevel | level, |
FILE * | fp | ||
) |
Adds a file to which log output is written.
All output at level level
or above it is written to fp
. The caller is responsible of closing fp
once the logger is discarded.
void gmx::LoggerBuilder::addTargetStream | ( | MDLogger::LogLevel | level, |
TextOutputStream * | stream | ||
) |
Adds a stream to which log output is written.
All output at level level
or above it is written to stream
. The caller is responsible of closing and freeing stream
once the logger is discarded.
LoggerOwner gmx::LoggerBuilder::build | ( | ) |
Builds the logger with the targets set for this builder.
After this function has been called, the builder can (and should) be discarded.