walberla::logging::Logging Class Reference

#include <Logging.h>

+ Inheritance diagram for walberla::logging::Logging:

Classes

class  CustomStamp
 

Public Types

enum  LogLevel {
  WARNING = 0, INFO = 1, PROGRESS = 2, DETAIL = 3,
  TRACING = 4
}
 

Public Member Functions

 ~Logging ()
 
void setLogLevel (LogLevel logLevel)
 
void setStreamLogLevel (LogLevel logLevel)
 
LogLevel getStreamLogLevel () const
 
void setFileLogLevel (LogLevel logLevel)
 
LogLevel getFileLogLevel () const
 
void includeLoggingToFile (const std::string &file=std::string(""), bool append=false)
 
void stopLoggingToFile ()
 
bool loggingToFile () const
 
void showTimeStamp (bool show)
 
bool showTimeStamp () const
 
void addCustomStamp (const shared_ptr< CustomStamp > &stamp)
 
void clearCustomStamp ()
 
bool usesCustomStamp () const
 
void logCallerPath (bool log)
 
bool logCallerPath () const
 
void addIgnoreRegex (const walberla::regex &regex)
 
const std::vector< walberla::regex > & getIgnoreRegexes () const
 
void clearIgnoreRegexes ()
 
void addIgnoreWarningRegex (const walberla::regex &regex)
 
const std::vector< walberla::regex > & getIgnoreWarningRegexes () const
 
void clearIgnoreWarningRegexes ()
 
bool onRoot () const
 
bool logDevel (const std::string &callerPath, const int line)
 
bool logResult (const std::string &callerPath, const int line)
 
bool logWarning (const std::string &callerPath, const int line)
 
bool logInfo (const std::string &callerPath, const int line)
 
bool logProgress (const std::string &callerPath, const int line)
 
bool logDetail (const std::string &callerPath, const int line)
 
bool logTracing (const std::string &callerPath, const int line)
 

Static Public Member Functions

static void printHeaderOnStream ()
 
static void printFooterOnStream ()
 

Static Public Attributes

static const std::string ERROR_TAG = std::string( "[ERROR ]" )
 
static const std::string DEVEL_TAG = std::string( "[DEVEL ]" )
 
static const std::string RESULT_TAG = std::string( "[RESULT ]" )
 
static const std::string WARNING_TAG = std::string( "[WARNING ]" )
 
static const std::string INFO_TAG = std::string( "[INFO ]" )
 
static const std::string PROGRESS_TAG = std::string( "[PROGRESS]" )
 
static const std::string DETAIL_TAG = std::string( "[DETAIL ]" )
 
static const std::string TRACING_TAG = std::string( "[TRACING ]" )
 
static const uint_t TAG_WIDTH = uint_t(10)
 
static const uint_t TIMESTAMP_WIDTH = uint_t(17)
 

Private Member Functions

 Logging ()
 
bool isInIgnoreCallerPaths (const std::vector< walberla::regex > &regexes, const std::string &callerPath, const int line) const
 
void logError (const std::string &message, const std::string &callerPath, const int line)
 
void logDevel (const std::string &message, const std::string &callerPath, const int line)
 
void logResult (const std::string &message, const std::string &callerPath, const int line)
 
void logWarning (const std::string &message, const std::string &callerPath, const int line)
 
void logInfo (const std::string &message, const std::string &callerPath, const int line)
 
void logProgress (const std::string &message, const std::string &callerPath, const int line)
 
void logDetail (const std::string &message, const std::string &callerPath, const int line)
 
void logTracing (const std::string &message, const std::string &callerPath, const int line)
 
void logMessage (LogLevel logLevel, std::ostream &stream, const std::string &message)
 
std::string getRankStamp () const
 
std::string resetLinebreaks (const std::string &message) const
 
std::string getTimeStamp () const
 
std::string createLog (const std::string &type, const std::string &message, const std::string &callerPath, const int line) const
 

Static Private Member Functions

static std::string getHeaderFooter (bool header)
 

Private Attributes

 WALBERLA_BEFRIEND_SINGLETON
 
LogLevel streamLogLevel_
 
LogLevel fileLogLevel_
 
std::ofstream file_
 
uint_t processId_
 
uint_t numberOfProcesses_
 
double startTime_
 
bool showTimeStamp_
 
shared_ptr< CustomStampadditionalStamp_
 
bool logCallerPath_
 
std::vector< walberla::regex > ignoreRegexes_
 
std::vector< walberla::regex > ignoreWarningRegexes_
 

Friends

class walberla::Abort
 
class walberla::Environment
 
class internal::LoggingMacroDispatcher
 
class Tracer
 

Member Enumeration Documentation

◆ LogLevel

Enumerator
WARNING 
INFO 
PROGRESS 
DETAIL 
TRACING 

Constructor & Destructor Documentation

◆ ~Logging()

walberla::logging::Logging::~Logging ( )
inline

◆ Logging()

walberla::logging::Logging::Logging ( )
inlineprivate

Member Function Documentation

◆ addCustomStamp()

void walberla::logging::Logging::addCustomStamp ( const shared_ptr< CustomStamp > &  stamp)
inline

◆ addIgnoreRegex()

void walberla::logging::Logging::addIgnoreRegex ( const walberla::regex &  regex)
inline

◆ addIgnoreWarningRegex()

void walberla::logging::Logging::addIgnoreWarningRegex ( const walberla::regex &  regex)
inline

◆ clearCustomStamp()

void walberla::logging::Logging::clearCustomStamp ( )
inline

◆ clearIgnoreRegexes()

void walberla::logging::Logging::clearIgnoreRegexes ( )
inline

◆ clearIgnoreWarningRegexes()

void walberla::logging::Logging::clearIgnoreWarningRegexes ( )
inline

◆ createLog()

std::string walberla::logging::Logging::createLog ( const std::string &  type,
const std::string &  message,
const std::string &  callerPath,
const int  line 
) const
private

◆ getFileLogLevel()

LogLevel walberla::logging::Logging::getFileLogLevel ( ) const
inline

◆ getHeaderFooter()

std::string walberla::logging::Logging::getHeaderFooter ( bool  header)
staticprivate

◆ getIgnoreRegexes()

const std::vector< walberla::regex >& walberla::logging::Logging::getIgnoreRegexes ( ) const
inline

◆ getIgnoreWarningRegexes()

const std::vector< walberla::regex >& walberla::logging::Logging::getIgnoreWarningRegexes ( ) const
inline

◆ getRankStamp()

std::string walberla::logging::Logging::getRankStamp ( ) const
inlineprivate

◆ getStreamLogLevel()

LogLevel walberla::logging::Logging::getStreamLogLevel ( ) const
inline

◆ getTimeStamp()

std::string walberla::logging::Logging::getTimeStamp ( ) const
inlineprivate

◆ includeLoggingToFile()

void walberla::logging::Logging::includeLoggingToFile ( const std::string &  file = std::string(""),
bool  append = false 
)

◆ isInIgnoreCallerPaths()

bool walberla::logging::Logging::isInIgnoreCallerPaths ( const std::vector< walberla::regex > &  regexes,
const std::string &  callerPath,
const int  line 
) const
private

◆ logCallerPath() [1/2]

bool walberla::logging::Logging::logCallerPath ( ) const
inline

◆ logCallerPath() [2/2]

void walberla::logging::Logging::logCallerPath ( bool  log)
inline

◆ logDetail() [1/2]

bool walberla::logging::Logging::logDetail ( const std::string &  callerPath,
const int  line 
)
inline

◆ logDetail() [2/2]

void walberla::logging::Logging::logDetail ( const std::string &  message,
const std::string &  callerPath,
const int  line 
)
inlineprivate

◆ logDevel() [1/2]

bool walberla::logging::Logging::logDevel ( const std::string &  callerPath,
const int  line 
)
inline

◆ logDevel() [2/2]

void walberla::logging::Logging::logDevel ( const std::string &  message,
const std::string &  callerPath,
const int  line 
)
inlineprivate

◆ logError()

void walberla::logging::Logging::logError ( const std::string &  message,
const std::string &  callerPath,
const int  line 
)
inlineprivate

◆ loggingToFile()

bool walberla::logging::Logging::loggingToFile ( ) const
inline

◆ logInfo() [1/2]

bool walberla::logging::Logging::logInfo ( const std::string &  callerPath,
const int  line 
)
inline

◆ logInfo() [2/2]

void walberla::logging::Logging::logInfo ( const std::string &  message,
const std::string &  callerPath,
const int  line 
)
inlineprivate

◆ logMessage()

void walberla::logging::Logging::logMessage ( LogLevel  logLevel,
std::ostream &  stream,
const std::string &  message 
)
inlineprivate

◆ logProgress() [1/2]

bool walberla::logging::Logging::logProgress ( const std::string &  callerPath,
const int  line 
)
inline

◆ logProgress() [2/2]

void walberla::logging::Logging::logProgress ( const std::string &  message,
const std::string &  callerPath,
const int  line 
)
inlineprivate

◆ logResult() [1/2]

bool walberla::logging::Logging::logResult ( const std::string &  callerPath,
const int  line 
)
inline

◆ logResult() [2/2]

void walberla::logging::Logging::logResult ( const std::string &  message,
const std::string &  callerPath,
const int  line 
)
inlineprivate

◆ logTracing() [1/2]

bool walberla::logging::Logging::logTracing ( const std::string &  callerPath,
const int  line 
)
inline

◆ logTracing() [2/2]

void walberla::logging::Logging::logTracing ( const std::string &  message,
const std::string &  callerPath,
const int  line 
)
inlineprivate

◆ logWarning() [1/2]

bool walberla::logging::Logging::logWarning ( const std::string &  callerPath,
const int  line 
)
inline

◆ logWarning() [2/2]

void walberla::logging::Logging::logWarning ( const std::string &  message,
const std::string &  callerPath,
const int  line 
)
inlineprivate

◆ onRoot()

bool walberla::logging::Logging::onRoot ( ) const
inline

◆ printFooterOnStream()

void walberla::logging::Logging::printFooterOnStream ( )
inlinestatic

◆ printHeaderOnStream()

void walberla::logging::Logging::printHeaderOnStream ( )
inlinestatic

◆ resetLinebreaks()

std::string walberla::logging::Logging::resetLinebreaks ( const std::string &  message) const
inlineprivate

◆ setFileLogLevel()

void walberla::logging::Logging::setFileLogLevel ( LogLevel  logLevel)

◆ setLogLevel()

void walberla::logging::Logging::setLogLevel ( LogLevel  logLevel)
inline

◆ setStreamLogLevel()

void walberla::logging::Logging::setStreamLogLevel ( LogLevel  logLevel)

◆ showTimeStamp() [1/2]

bool walberla::logging::Logging::showTimeStamp ( ) const
inline

◆ showTimeStamp() [2/2]

void walberla::logging::Logging::showTimeStamp ( bool  show)
inline

◆ stopLoggingToFile()

void walberla::logging::Logging::stopLoggingToFile ( )
inline

◆ usesCustomStamp()

bool walberla::logging::Logging::usesCustomStamp ( ) const
inline

Friends And Related Function Documentation

◆ internal::LoggingMacroDispatcher

friend class internal::LoggingMacroDispatcher
friend

◆ Tracer

friend class Tracer
friend

◆ walberla::Abort

friend class walberla::Abort
friend

◆ walberla::Environment

friend class walberla::Environment
friend

Member Data Documentation

◆ additionalStamp_

shared_ptr< CustomStamp > walberla::logging::Logging::additionalStamp_
private

◆ DETAIL_TAG

const std::string walberla::logging::Logging::DETAIL_TAG = std::string( "[DETAIL ]" )
static

◆ DEVEL_TAG

const std::string walberla::logging::Logging::DEVEL_TAG = std::string( "[DEVEL ]" )
static

◆ ERROR_TAG

const std::string walberla::logging::Logging::ERROR_TAG = std::string( "[ERROR ]" )
static

◆ file_

std::ofstream walberla::logging::Logging::file_
private

◆ fileLogLevel_

LogLevel walberla::logging::Logging::fileLogLevel_
private

◆ ignoreRegexes_

std::vector< walberla::regex > walberla::logging::Logging::ignoreRegexes_
private

◆ ignoreWarningRegexes_

std::vector< walberla::regex > walberla::logging::Logging::ignoreWarningRegexes_
private

◆ INFO_TAG

const std::string walberla::logging::Logging::INFO_TAG = std::string( "[INFO ]" )
static

◆ logCallerPath_

bool walberla::logging::Logging::logCallerPath_
private

◆ numberOfProcesses_

uint_t walberla::logging::Logging::numberOfProcesses_
private

◆ processId_

uint_t walberla::logging::Logging::processId_
private

◆ PROGRESS_TAG

const std::string walberla::logging::Logging::PROGRESS_TAG = std::string( "[PROGRESS]" )
static

◆ RESULT_TAG

const std::string walberla::logging::Logging::RESULT_TAG = std::string( "[RESULT ]" )
static

◆ showTimeStamp_

bool walberla::logging::Logging::showTimeStamp_
private

◆ startTime_

double walberla::logging::Logging::startTime_
private

◆ streamLogLevel_

LogLevel walberla::logging::Logging::streamLogLevel_
private

◆ TAG_WIDTH

const uint_t walberla::logging::Logging::TAG_WIDTH = uint_t(10)
static

◆ TIMESTAMP_WIDTH

const uint_t walberla::logging::Logging::TIMESTAMP_WIDTH = uint_t(17)
static

◆ TRACING_TAG

const std::string walberla::logging::Logging::TRACING_TAG = std::string( "[TRACING ]" )
static

◆ WALBERLA_BEFRIEND_SINGLETON

walberla::logging::Logging::WALBERLA_BEFRIEND_SINGLETON
private

◆ WARNING_TAG

const std::string walberla::logging::Logging::WARNING_TAG = std::string( "[WARNING ]" )
static

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