Peano
Loading...
Searching...
No Matches
tarch::logging::ChromeTraceFileLogger Class Reference

Chrome Trace File Logger. More...

#include <ChromeTraceFileLogger.h>

Collaboration diagram for tarch::logging::ChromeTraceFileLogger:

Public Member Functions

 ~ChromeTraceFileLogger ()
 
void debug (long int timestampMS, int rank, int threadId, const std::string &trace, const std::string &message)
 
void info (long int timestampMS, int rank, int threadId, const std::string &trace, const std::string &message)
 
void warning (long int timestampMS, int rank, int threadId, const std::string &trace, const std::string &message)
 
void error (long int timestampMS, int rank, int threadId, const std::string &trace, const std::string &message)
 
void traceIn (long int timestampMS, int rank, int threadId, const std::string &trace, const std::string &message)
 
void traceOut (long int timestampMS, int rank, int threadId, const std::string &trace, const std::string &message)
 
void indent (bool indent, const std::string &trace, const std::string &message)
 Tells the logger to increment/decrement the indent.
 
void setOutputFile (const std::string &outputLogFileName)
 Is redundant, as you could use setLogFormat() instead.
 
void setQuitOnError (bool value)
 
void close ()
 

Static Public Member Functions

static ChromeTraceFileLoggergetInstance ()
 

Private Member Functions

void nextEntry ()
 
ChromeTraceFileLoggeroperator= (const ChromeTraceFileLogger &)
 Declared private since assignment does not make sense for an output class (output information mismatch).
 
 ChromeTraceFileLogger (const ChromeTraceFileLogger &)
 Declared private since copying does not make sense for an output class (output information mismatch).
 
std::string addSeparators (std::string message) const
 Ensures each column has same length.
 
std::string constructMessageString (std::string messageType, long int timestampMS, int rank, int threadId, const std::string &trace, const std::string &message)
 Construct message string for output to terminal.
 
std::string constructEventEntryInTraceFile (std::string messageType, long int timestampMS, int rank, int threadId, const std::string &trace, const std::string &message)
 
void configureOutputStreams ()
 Configures the output streams.
 
 ChromeTraceFileLogger ()
 It's a singleton.
 

Private Attributes

tarch::multicore::BooleanSemaphore _semaphore
 
std::ostream * _outputStream
 Test for the column separator of a string output.
 
bool _quitOnError
 
bool _hasWrittenEntry
 

Static Private Attributes

static Log _log
 
static ChromeTraceFileLogger _singleton
 

Detailed Description

Chrome Trace File Logger.

To visualise the output files, either use Google's Chrome or the trace file viewer from The Chromium Projects. In Ubuntu, simply install the Chromium web browser. Once launched, type in chrome://tracing/ and press enter. After that, you can load the trace file.

Author
Tobias Weinzierl

Definition at line 34 of file ChromeTraceFileLogger.h.

Constructor & Destructor Documentation

◆ ChromeTraceFileLogger() [1/2]

tarch::logging::ChromeTraceFileLogger::ChromeTraceFileLogger ( const ChromeTraceFileLogger & )
private

Declared private since copying does not make sense for an output class (output information mismatch).

◆ ChromeTraceFileLogger() [2/2]

tarch::logging::ChromeTraceFileLogger::ChromeTraceFileLogger ( )
private

It's a singleton.

◆ ~ChromeTraceFileLogger()

tarch::logging::ChromeTraceFileLogger::~ChromeTraceFileLogger ( )

Member Function Documentation

◆ addSeparators()

std::string tarch::logging::ChromeTraceFileLogger::addSeparators ( std::string message) const
private

Ensures each column has same length.

◆ close()

void tarch::logging::ChromeTraceFileLogger::close ( )

◆ configureOutputStreams()

void tarch::logging::ChromeTraceFileLogger::configureOutputStreams ( )
private

Configures the output streams.

◆ constructEventEntryInTraceFile()

std::string tarch::logging::ChromeTraceFileLogger::constructEventEntryInTraceFile ( std::string messageType,
long int timestampMS,
int rank,
int threadId,
const std::string & trace,
const std::string & message )
private

◆ constructMessageString()

std::string tarch::logging::ChromeTraceFileLogger::constructMessageString ( std::string messageType,
long int timestampMS,
int rank,
int threadId,
const std::string & trace,
const std::string & message )
private

Construct message string for output to terminal.

I pipe data to the terminal for error messages, warnings and infos.

◆ debug()

void tarch::logging::ChromeTraceFileLogger::debug ( long int timestampMS,
int rank,
int threadId,
const std::string & trace,
const std::string & message )

◆ error()

void tarch::logging::ChromeTraceFileLogger::error ( long int timestampMS,
int rank,
int threadId,
const std::string & trace,
const std::string & message )

◆ getInstance()

static ChromeTraceFileLogger & tarch::logging::ChromeTraceFileLogger::getInstance ( )
static

◆ indent()

void tarch::logging::ChromeTraceFileLogger::indent ( bool indent,
const std::string & trace,
const std::string & message )

Tells the logger to increment/decrement the indent.

Implemented for compatibility reasons

◆ info()

void tarch::logging::ChromeTraceFileLogger::info ( long int timestampMS,
int rank,
int threadId,
const std::string & trace,
const std::string & message )

◆ nextEntry()

void tarch::logging::ChromeTraceFileLogger::nextEntry ( )
private

◆ operator=()

ChromeTraceFileLogger & tarch::logging::ChromeTraceFileLogger::operator= ( const ChromeTraceFileLogger & )
private

Declared private since assignment does not make sense for an output class (output information mismatch).

◆ setOutputFile()

void tarch::logging::ChromeTraceFileLogger::setOutputFile ( const std::string & outputLogFileName)

Is redundant, as you could use setLogFormat() instead.

However, it is tedious to specify all of these parameters if the only thing you want is to establish an output file.

◆ setQuitOnError()

void tarch::logging::ChromeTraceFileLogger::setQuitOnError ( bool value)

◆ traceIn()

void tarch::logging::ChromeTraceFileLogger::traceIn ( long int timestampMS,
int rank,
int threadId,
const std::string & trace,
const std::string & message )

◆ traceOut()

void tarch::logging::ChromeTraceFileLogger::traceOut ( long int timestampMS,
int rank,
int threadId,
const std::string & trace,
const std::string & message )

◆ warning()

void tarch::logging::ChromeTraceFileLogger::warning ( long int timestampMS,
int rank,
int threadId,
const std::string & trace,
const std::string & message )

Field Documentation

◆ _hasWrittenEntry

bool tarch::logging::ChromeTraceFileLogger::_hasWrittenEntry
private

Definition at line 47 of file ChromeTraceFileLogger.h.

◆ _log

Log tarch::logging::ChromeTraceFileLogger::_log
staticprivate

Definition at line 36 of file ChromeTraceFileLogger.h.

◆ _outputStream

std::ostream* tarch::logging::ChromeTraceFileLogger::_outputStream
private

Test for the column separator of a string output.

Definition at line 45 of file ChromeTraceFileLogger.h.

◆ _quitOnError

bool tarch::logging::ChromeTraceFileLogger::_quitOnError
private

Definition at line 46 of file ChromeTraceFileLogger.h.

◆ _semaphore

tarch::multicore::BooleanSemaphore tarch::logging::ChromeTraceFileLogger::_semaphore
private

Definition at line 40 of file ChromeTraceFileLogger.h.

◆ _singleton

ChromeTraceFileLogger tarch::logging::ChromeTraceFileLogger::_singleton
staticprivate

Definition at line 38 of file ChromeTraceFileLogger.h.


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