preCICE
Loading...
Searching...
No Matches
precice::logging Namespace Reference

contains the logging framework. More...

Namespaces

namespace  keywords

Classes

class  LogConfiguration
 Configures the log config file to use. More...
class  timestamp_formatter_factory
 A custom formatter that handles the TimeStamp format string. More...
class  colorized_severity_formatter_factory
 A custom formatter that handles the colorized Severity formatting. More...
class  severity_formatter_factory
 A custom formatter that handles non-colorized Severity formatting. More...
class  NullSink
 A custom sink that does nothing. It is used to disable the default sink of boost.Log. More...
class  StreamBackend
 A simple backends that outputs the message to a stream. More...
struct  BackendConfiguration
 Holds the configuration for one logging backend (sink) and takes care of default values. More...
struct  GlobalLoggingConfig
 Holds global logging data in a central place. More...
class  precice_feature
 A feature that adds LogLocation info to log attributes. More...
struct  precice_log
 Required by BoostLogger to use precice_feature. More...
struct  LogLocation
 Struct used to capture the original location of a log request. More...
class  Logger
 This class provides a lightweight logger. More...
class  Tracer

Typedefs

using LoggingConfiguration = std::vector<BackendConfiguration>
 Holds the configuration of the logging system.
template<class BaseLogger>
using BoostLogger
 The boost logger that combines required features.

Functions

LoggingConfiguration readLogConfFile (std::string const &filename)
 Reads a log file, returns a logging configuration.
static boost::log::formatter createDefaultFormatter ()
static boost::log::filter createDefaultFilter ()
void setupLogging (LoggingConfiguration configs, bool enabled=true)
 Configures the logging from a LoggingConfiguration.
void setupLogging (std::string const &logConfigFile="log.conf")
 Configures the logging from a log file.
void setMPIRank (int const rank)
void setParticipant (std::string const &participant)
GlobalLoggingConfiggetGlobalLoggingConfig ()
 Returns the global logging configuration.
void lockConf ()
template<class Error>
void logErrorAndThrow (precice::logging::Logger &log, precice::logging::LogLocation location, const std::string &message)
 Utility function to log an error and throw an exception of given type.

Detailed Description

contains the logging framework.

Typedef Documentation

◆ BoostLogger

template<class BaseLogger>
using precice::logging::BoostLogger
Initial value:
boost::log::sources::basic_composite_logger<
char,
BaseLogger,
boost::log::sources::single_thread_model,
boost::log::sources::features<
boost::log::sources::severity<boost::log::trivial::severity_level>,
Required by BoostLogger to use precice_feature.
Definition Logger.cpp:84

The boost logger that combines required features.

Definition at line 89 of file Logger.cpp.

◆ LoggingConfiguration

Holds the configuration of the logging system.

Definition at line 32 of file LogConfiguration.hpp.

Function Documentation

◆ createDefaultFilter()

boost::log::filter precice::logging::createDefaultFilter ( )
static

Definition at line 192 of file LogConfiguration.cpp.

◆ createDefaultFormatter()

boost::log::formatter precice::logging::createDefaultFormatter ( )
static

Definition at line 169 of file LogConfiguration.cpp.

◆ getGlobalLoggingConfig()

GlobalLoggingConfig & precice::logging::getGlobalLoggingConfig ( )

Returns the global logging configuration.

Definition at line 336 of file LogConfiguration.cpp.

◆ lockConf()

void precice::logging::lockConf ( )

Locks the configuration, ignoring any future calls to setupLogging()

See also
GlobalLoggingConfig

Definition at line 342 of file LogConfiguration.cpp.

Here is the call graph for this function:

◆ logErrorAndThrow()

template<class Error>
void precice::logging::logErrorAndThrow ( precice::logging::Logger & log,
precice::logging::LogLocation location,
const std::string & message )
inline

Utility function to log an error and throw an exception of given type.

Definition at line 50 of file Logger.hpp.

Here is the call graph for this function:

◆ readLogConfFile()

LoggingConfiguration precice::logging::readLogConfFile ( std::string const & filename)

Reads a log file, returns a logging configuration.

Reads a log configuration file, returns vector of BackEndConfiguration.

Definition at line 126 of file LogConfiguration.cpp.

Here is the call graph for this function:

◆ setMPIRank()

void precice::logging::setMPIRank ( int const rank)

Sets the current MPI rank as a logging attribute

See also
GlobalLoggingConfig

Definition at line 326 of file LogConfiguration.cpp.

Here is the call graph for this function:

◆ setParticipant()

void precice::logging::setParticipant ( std::string const & name)

Sets the name of the current participant as a logging attribute

See also
GlobalLoggingConfig

Definition at line 331 of file LogConfiguration.cpp.

Here is the call graph for this function:

◆ setupLogging() [1/2]

void precice::logging::setupLogging ( LoggingConfiguration configs,
bool enabled )

Configures the logging from a LoggingConfiguration.

Definition at line 227 of file LogConfiguration.cpp.

Here is the call graph for this function:

◆ setupLogging() [2/2]

void precice::logging::setupLogging ( std::string const & logConfigFile)

Configures the logging from a log file.

Definition at line 321 of file LogConfiguration.cpp.

Here is the call graph for this function: