Peano 4
Loading...
Searching...
No Matches
tarch::logging::LogFilter Class Reference

Peano4's log filter is used by every single log instance. More...

#include <LogFilter.h>

Collaboration diagram for tarch::logging::LogFilter:

Data Structures

struct  FilterListEntry
 Represents one entry of the filter list. More...
 

Public Types

typedef std::set< FilterListEntryFilterList
 

Public Member Functions

 LogFilter ()
 By default, everything is on.
 
bool filterOut (const std::string &targetName, const std::string &className)
 May not be const as it might write a warning itself.
 
 ~LogFilter ()
 
void addFilterListEntry (const FilterListEntry &entry)
 Add one filter list entry.
 
void addFilterListEntries (const FilterList &entries)
 
void clearFilterList ()
 
void printFilterListToCout () const
 
bool writeDebug (const std::string &trace)
 
bool writeInfo (const std::string &trace)
 
bool writeTrace (const std::string &trace)
 
bool writeWarning (const std::string &trace)
 
void switchProgramPhase (const std::string &activeProgramPhase)
 

Static Public Member Functions

static LogFiltergetInstance ()
 

Data Fields

FilterList _filterlist
 

Private Attributes

std::string _activeProgramPhase
 

Detailed Description

Peano4's log filter is used by every single log instance.

Please note that the fourth generation of Peano allows users to filter only w.r.t. the class name. You can't filter on the method level anymore.

Definition at line 20 of file LogFilter.h.

Member Typedef Documentation

◆ FilterList

Definition at line 89 of file LogFilter.h.

Constructor & Destructor Documentation

◆ LogFilter()

tarch::logging::LogFilter::LogFilter ( )

By default, everything is on.

Definition at line 82 of file LogFilter.cpp.

References _activeProgramPhase, addFilterListEntry(), and tarch::logging::LogFilter::FilterListEntry::TargetAll.

Here is the call graph for this function:

◆ ~LogFilter()

tarch::logging::LogFilter::~LogFilter ( )

Definition at line 91 of file LogFilter.cpp.

Member Function Documentation

◆ addFilterListEntries()

void tarch::logging::LogFilter::addFilterListEntries ( const FilterList & entries)

Definition at line 152 of file LogFilter.cpp.

◆ addFilterListEntry()

void tarch::logging::LogFilter::addFilterListEntry ( const FilterListEntry & entry)

Add one filter list entry.

If you wanna switch on the logging globally, please add

tarch::logging::ChromeTraceFileLogger::getInstance().addFilterListEntry(tarch::logging::ChromeTraceFileLogger::FilterListEntry());

to your configuration.

Definition at line 196 of file LogFilter.cpp.

References assertion, and tarch::logging::LogFilter::FilterListEntry::toString().

Referenced by tarch::logging::LogFilterFileReader::interpretTokens(), LogFilter(), main(), tarch::logging::LogFilterFileReader::parsePlainTextFile(), exahype2::setDefaultLogStatements(), and swift2::setDefaultLogStatements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearFilterList()

void tarch::logging::LogFilter::clearFilterList ( )

Definition at line 158 of file LogFilter.cpp.

Referenced by tarch::logging::LogFilterFileReader::parsePlainTextFile().

Here is the caller graph for this function:

◆ filterOut()

bool tarch::logging::LogFilter::filterOut ( const std::string & targetName,
const std::string & className )

May not be const as it might write a warning itself.

Is public as some analysis frameworks check explicitly whether these features are switched on.

Definition at line 162 of file LogFilter.cpp.

References tarch::mpi::Rank::getInstance(), and tarch::mpi::Rank::getRank().

Here is the call graph for this function:

◆ getInstance()

◆ printFilterListToCout()

void tarch::logging::LogFilter::printFilterListToCout ( ) const

Definition at line 98 of file LogFilter.cpp.

◆ switchProgramPhase()

void tarch::logging::LogFilter::switchProgramPhase ( const std::string & activeProgramPhase)

Definition at line 114 of file LogFilter.cpp.

Referenced by step().

Here is the caller graph for this function:

◆ writeDebug()

bool tarch::logging::LogFilter::writeDebug ( const std::string & trace)

Definition at line 127 of file LogFilter.cpp.

◆ writeInfo()

bool tarch::logging::LogFilter::writeInfo ( const std::string & trace)

Definition at line 135 of file LogFilter.cpp.

◆ writeTrace()

bool tarch::logging::LogFilter::writeTrace ( const std::string & trace)

Definition at line 143 of file LogFilter.cpp.

◆ writeWarning()

bool tarch::logging::LogFilter::writeWarning ( const std::string & trace)

Definition at line 139 of file LogFilter.cpp.

Field Documentation

◆ _activeProgramPhase

std::string tarch::logging::LogFilter::_activeProgramPhase
private

Definition at line 22 of file LogFilter.h.

Referenced by LogFilter().

◆ _filterlist

FilterList tarch::logging::LogFilter::_filterlist

Definition at line 91 of file LogFilter.h.


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