https://mooseframework.inl.gov
Public Member Functions | Protected Attributes | List of all members
LoggingInterface Class Reference

Interface class for logging errors and warnings. More...

#include <LoggingInterface.h>

Inheritance diagram for LoggingInterface:
[legend]

Public Member Functions

 LoggingInterface (Logger &log)
 Constructor. More...
 
template<typename... Args>
void logError (Args &&... args) const
 Logs an error. More...
 
template<typename... Args>
void logComponentError (const std::string &component_name, Args &&... args) const
 Logs an error for a component. More...
 
template<typename... Args>
void logWarning (Args &&... args) const
 Logs a warning. More...
 
template<typename... Args>
void logComponentWarning (const std::string &component_name, Args &&... args) const
 Logs a warning for a component. More...
 

Protected Attributes

Logger_log
 

Detailed Description

Interface class for logging errors and warnings.

This allows errors/warnings to be cached and output all at once instead of needing to stop each time an error is encountered.

Definition at line 22 of file LoggingInterface.h.

Constructor & Destructor Documentation

◆ LoggingInterface()

LoggingInterface::LoggingInterface ( Logger log)

Constructor.

Parameters
[in]fe_problemFEProblemBase-derived object that has the Logger instance

Definition at line 13 of file LoggingInterface.C.

13 : _log(log) {}

Member Function Documentation

◆ logComponentError()

template<typename... Args>
void LoggingInterface::logComponentError ( const std::string &  component_name,
Args &&...  args 
) const
inline

Logs an error for a component.

Parameters
[in]component_nameName of the component

Definition at line 47 of file LoggingInterface.h.

Referenced by Closures1PhaseSimple::checkFlowChannel(), Closures1PhaseSimple::checkHeatTransfer(), and Component::logError().

48  {
49  _log.add(Logger::ERROR, component_name, ": ", std::forward<Args>(args)...);
50  }
void add(EMessageType type, Args &&... args)
Add a message to the log.
Definition: Logger.h:35

◆ logComponentWarning()

template<typename... Args>
void LoggingInterface::logComponentWarning ( const std::string &  component_name,
Args &&...  args 
) const
inline

Logs a warning for a component.

Parameters
[in]component_nameName of the component

Definition at line 67 of file LoggingInterface.h.

Referenced by Component::logWarning().

68  {
69  _log.add(Logger::WARNING, component_name, ": ", std::forward<Args>(args)...);
70  }
void add(EMessageType type, Args &&... args)
Add a message to the log.
Definition: Logger.h:35

◆ logError()

template<typename... Args>
void LoggingInterface::logError ( Args &&...  args) const
inline

Logs an error.

Definition at line 36 of file LoggingInterface.h.

Referenced by Simulation::addClosures(), Simulation::addComponent(), Simulation::controlDataIntegrityCheck(), Simulation::declareControlData(), Simulation::identifyLoops(), and Simulation::integrityCheck().

37  {
38  _log.add(Logger::ERROR, std::forward<Args>(args)...);
39  }
void add(EMessageType type, Args &&... args)
Add a message to the log.
Definition: Logger.h:35

◆ logWarning()

template<typename... Args>
void LoggingInterface::logWarning ( Args &&...  args) const
inline

Logs a warning.

Definition at line 56 of file LoggingInterface.h.

57  {
58  _log.add(Logger::WARNING, std::forward<Args>(args)...);
59  }
void add(EMessageType type, Args &&... args)
Add a message to the log.
Definition: Logger.h:35

Member Data Documentation

◆ _log

Logger& LoggingInterface::_log
protected

Definition at line 73 of file LoggingInterface.h.

Referenced by logComponentError(), logComponentWarning(), logError(), and logWarning().


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