Opm::LogBackend Class Referenceabstract

Abstract interface class for log backends. More...

#include <LogBackend.hpp>

Inheritance diagram for Opm::LogBackend:
Inheritance graph

Public Member Functions

 LogBackend (int64_t mask)
 Construct with given message mask. More...
 
virtual ~LogBackend ()
 Virtual destructor to enable inheritance. More...
 
void setMessageFormatter (std::shared_ptr< MessageFormatterInterface > formatter)
 Configure how formatMessage() will modify message strings. More...
 
void setMessageLimiter (std::shared_ptr< MessageLimiter > limiter)
 Configure how message tags will be used to limit messages. More...
 
void addMessage (int64_t messageFlag, const std::string &message)
 Add a message to the backend if accepted by the message limiter. More...
 
void addTaggedMessage (int64_t messageFlag, const std::string &messageTag, const std::string &message)
 Add a tagged message to the backend if accepted by the message limiter. More...
 
int64_t getMask () const
 

Protected Member Functions

virtual void addMessageUnconditionally (int64_t messageFlag, const std::string &message)=0
 
std::string formatMessage (int64_t messageFlag, const std::string &message)
 Return decorated version of message depending on configureDecoration() arguments. More...
 

Detailed Description

Abstract interface class for log backends.

Constructor & Destructor Documentation

◆ LogBackend()

Opm::LogBackend::LogBackend ( int64_t  mask)
explicit

Construct with given message mask.

◆ ~LogBackend()

virtual Opm::LogBackend::~LogBackend ( )
virtual

Virtual destructor to enable inheritance.

Member Function Documentation

◆ addMessage()

void Opm::LogBackend::addMessage ( int64_t  messageFlag,
const std::string message 
)

Add a message to the backend if accepted by the message limiter.

◆ addMessageUnconditionally()

virtual void Opm::LogBackend::addMessageUnconditionally ( int64_t  messageFlag,
const std::string message 
)
protectedpure virtual

This is the method subclasses should override.

Typically a subclass may filter, change, and output messages based on configuration and the messageFlag.

Implemented in Opm::CounterLog, Opm::TimerLog, Opm::EclipsePRTLog, and Opm::StreamLog.

◆ addTaggedMessage()

void Opm::LogBackend::addTaggedMessage ( int64_t  messageFlag,
const std::string messageTag,
const std::string message 
)

Add a tagged message to the backend if accepted by the message limiter.

◆ formatMessage()

std::string Opm::LogBackend::formatMessage ( int64_t  messageFlag,
const std::string message 
)
protected

Return decorated version of message depending on configureDecoration() arguments.

◆ getMask()

int64_t Opm::LogBackend::getMask ( ) const

The message mask types are specified in the Opm::Log::MessageType namespace, in file LogUtils.hpp.

◆ setMessageFormatter()

void Opm::LogBackend::setMessageFormatter ( std::shared_ptr< MessageFormatterInterface formatter)

Configure how formatMessage() will modify message strings.

◆ setMessageLimiter()

void Opm::LogBackend::setMessageLimiter ( std::shared_ptr< MessageLimiter limiter)

Configure how message tags will be used to limit messages.


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