waLBerla 7.3
Loading...
Searching...
No Matches
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 std::regex &regex)
const std::vector< std::regex > & getIgnoreRegexes () const
void clearIgnoreRegexes ()
void addIgnoreWarningRegex (const std::regex &regex)
const std::vector< std::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 constexpr std::string_view ERROR_TAG = "[ERROR ]"
static constexpr std::string_view DEVEL_TAG = "[DEVEL ]"
static constexpr std::string_view RESULT_TAG = "[RESULT ]"
static constexpr std::string_view WARNING_TAG = "[WARNING ]"
static constexpr std::string_view INFO_TAG = "[INFO ]"
static constexpr std::string_view PROGRESS_TAG = "[PROGRESS]"
static constexpr std::string_view DETAIL_TAG = "[DETAIL ]"
static constexpr std::string_view TRACING_TAG = "[TRACING ]"
static constexpr uint_t TAG_WIDTH = uint_t{10}
static constexpr uint_t TIMESTAMP_WIDTH = uint_t{17}

Private Member Functions

 Logging ()
bool isInIgnoreCallerPaths (const std::vector< std::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 (std::string_view 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_ { WALBERLA_LOGLEVEL }
LogLevel fileLogLevel_ { WALBERLA_LOGLEVEL }
std::ofstream file_
uint_t processId_
uint_t numberOfProcesses_
double startTime_
bool showTimeStamp_ { true }
shared_ptr< CustomStampadditionalStamp_
bool logCallerPath_ { false }
std::vector< std::regex > ignoreRegexes_
std::vector< std::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 std::regex & regex)
inline

◆ addIgnoreWarningRegex()

void walberla::logging::Logging::addIgnoreWarningRegex ( const std::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 ( std::string_view 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< std::regex > & walberla::logging::Logging::getIgnoreRegexes ( ) const
inline

◆ getIgnoreWarningRegexes()

const std::vector< std::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< std::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

◆ 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

std::string_view walberla::logging::Logging::DETAIL_TAG = "[DETAIL ]"
staticconstexpr

◆ DEVEL_TAG

std::string_view walberla::logging::Logging::DEVEL_TAG = "[DEVEL ]"
staticconstexpr

◆ ERROR_TAG

std::string_view walberla::logging::Logging::ERROR_TAG = "[ERROR ]"
staticconstexpr

◆ file_

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

◆ fileLogLevel_

LogLevel walberla::logging::Logging::fileLogLevel_ { WALBERLA_LOGLEVEL }
private

◆ ignoreRegexes_

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

◆ ignoreWarningRegexes_

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

◆ INFO_TAG

std::string_view walberla::logging::Logging::INFO_TAG = "[INFO ]"
staticconstexpr

◆ logCallerPath_

bool walberla::logging::Logging::logCallerPath_ { false }
private

◆ numberOfProcesses_

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

◆ processId_

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

◆ PROGRESS_TAG

std::string_view walberla::logging::Logging::PROGRESS_TAG = "[PROGRESS]"
staticconstexpr

◆ RESULT_TAG

std::string_view walberla::logging::Logging::RESULT_TAG = "[RESULT ]"
staticconstexpr

◆ showTimeStamp_

bool walberla::logging::Logging::showTimeStamp_ { true }
private

◆ startTime_

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

◆ streamLogLevel_

LogLevel walberla::logging::Logging::streamLogLevel_ { WALBERLA_LOGLEVEL }
private

◆ TAG_WIDTH

uint_t walberla::logging::Logging::TAG_WIDTH = uint_t{10}
staticconstexpr

◆ TIMESTAMP_WIDTH

uint_t walberla::logging::Logging::TIMESTAMP_WIDTH = uint_t{17}
staticconstexpr

◆ TRACING_TAG

std::string_view walberla::logging::Logging::TRACING_TAG = "[TRACING ]"
staticconstexpr

◆ WALBERLA_BEFRIEND_SINGLETON

walberla::logging::Logging::WALBERLA_BEFRIEND_SINGLETON
private

◆ WARNING_TAG

std::string_view walberla::logging::Logging::WARNING_TAG = "[WARNING ]"
staticconstexpr

The documentation for this class was generated from the following files:
  • /builds/administration/walberla-website/walberla/src/core/logging/Logging.h
  • /builds/administration/walberla-website/walberla/src/core/logging/Logging.cpp