Gromacs  2020.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::LoggerBuilder Class Reference

#include <gromacs/utility/loggerbuilder.h>

Description

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...
 

Member Function Documentation

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.


The documentation for this class was generated from the following files: