|
Peano
|
Command Line Logger. More...
#include <NoLogger.h>

Public Member Functions | |
| ~NoLogger ()=default | |
| void | debug (long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message) |
| Nop. | |
| void | info (long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message) |
| void | warning (long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message) |
| Write Warning. | |
| void | error (long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message) |
| Write Error. | |
| void | traceIn (long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message) |
| Nop. | |
| void | traceOut (long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message) |
| Nop. | |
| void | indent (bool indent, const std::string &trace) |
| Nop. | |
| void | setQuitOnError (bool value) |
Static Public Member Functions | |
| static NoLogger & | getInstance () |
Private Member Functions | |
| NoLogger & | operator= (const NoLogger &)=delete |
| Declared private since assignment does not make sense for an output class (output information mismatch). | |
| NoLogger (const NoLogger &)=delete | |
| Declared private since copying does not make sense for an output class (output information mismatch). | |
| NoLogger () | |
| It's a singleton. | |
| std::string | constructMessageString (std::string messageType, long int timestampNanoseconds, int rank, int threadId, const std::string &trace, const std::string &message) |
Private Attributes | |
| tarch::multicore::BooleanSemaphore | _semaphore |
| bool | _quitOnError |
Static Private Attributes | |
| static Log | _log |
| static NoLogger | _singleton |
Command Line Logger.
Standard log output device. Implements the LogHandle. Usually there's only one instance of this class for only the Log type aggregates it in a static way. For a detailed description of this compiler flags please browse through the static consts of the class or the howto page.
An interesting issue is the behaviour of the command line logger in the parallel mode if debug is switched on. In this case the number of messages soon becomes unreadable for any human. Thus, the command line logger internally creates one output file rank.log for each rank and writes all the information into this file. info, warnings and errors are written (in short form) to std::cout / std::cerr, too.
If the debug mode is not set, all information is written to std::cout.
Note, that if multithreading is switched on (TBB-flag), the access to std::cout or the logfile respectively is synchronized. The other methods are not thread-safe and should be called only in safe context for defined behaviour.
Definition at line 48 of file NoLogger.h.
|
privatedelete |
Declared private since copying does not make sense for an output class (output information mismatch).
|
private |
It's a singleton.
|
default |
|
private |
| void tarch::logging::NoLogger::debug | ( | long int | timestampNanoseconds, |
| int | rank, | ||
| int | threadId, | ||
| const std::string & | trace, | ||
| const std::string & | message | ||
| ) |
Nop.
| void tarch::logging::NoLogger::error | ( | long int | timestampNanoseconds, |
| int | rank, | ||
| int | threadId, | ||
| const std::string & | trace, | ||
| const std::string & | message | ||
| ) |
Write Error.
In the implementation, I call a flush on cout before I write to cerr. Otherwise, the cerr messages might overtake cout. Before the operation returns, it does a flush on cerr, too. Otherwise, the message might not occur, i.e. the application might shut down before the message is flushed to the terminal.
|
static |
| void tarch::logging::NoLogger::indent | ( | bool | indent, |
| const std::string & | trace | ||
| ) |
Nop.
Definition at line 126 of file NoLogger.h.
| void tarch::logging::NoLogger::info | ( | long int | timestampNanoseconds, |
| int | rank, | ||
| int | threadId, | ||
| const std::string & | trace, | ||
| const std::string & | message | ||
| ) |
Declared private since assignment does not make sense for an output class (output information mismatch).
| void tarch::logging::NoLogger::setQuitOnError | ( | bool | value | ) |
| void tarch::logging::NoLogger::traceIn | ( | long int | timestampNanoseconds, |
| int | rank, | ||
| int | threadId, | ||
| const std::string & | trace, | ||
| const std::string & | message | ||
| ) |
Nop.
Definition at line 116 of file NoLogger.h.
| void tarch::logging::NoLogger::traceOut | ( | long int | timestampNanoseconds, |
| int | rank, | ||
| int | threadId, | ||
| const std::string & | trace, | ||
| const std::string & | message | ||
| ) |
Nop.
Definition at line 121 of file NoLogger.h.
| void tarch::logging::NoLogger::warning | ( | long int | timestampNanoseconds, |
| int | rank, | ||
| int | threadId, | ||
| const std::string & | trace, | ||
| const std::string & | message | ||
| ) |
Write Warning.
In the implementation, I call a flush on cout before I write to cerr. Otherwise, the cerr messages might overtake cout. Before the operation returns, it does a flush on cerr, too. Otherwise, the message might not occur, i.e. the application might shut down before the message is flushed to the terminal.
|
staticprivate |
Definition at line 50 of file NoLogger.h.
|
private |
Definition at line 56 of file NoLogger.h.
|
private |
Definition at line 54 of file NoLogger.h.
|
staticprivate |
Definition at line 52 of file NoLogger.h.