SFrame 3.6
|
Message writing class. More...
#include <core/include/SLogWriter.h>
Public Member Functions | |
~SLogWriter () | |
Default destructor. | |
void | Write (SMsgType type, const std::string &line) const |
Function writing a message to the output. | |
void | SetMinType (SMsgType type) |
Set the message type above which messages are printed. | |
SMsgType | GetMinType () const |
Get the message type above which messages are printed. | |
Static Public Member Functions | |
static SLogWriter * | Instance () |
Function for accessing the single object. | |
Protected Member Functions | |
SLogWriter () | |
Protected default constructor. |
Message writing class.
Singleton class for actually writing the formatted messages to the console.
Right now it only writes messages to the terminal, but one possibility would be to write messages to a file for batch running later on. (Just an idea...)
Definition at line 37 of file SLogWriter.h.
SLogWriter::~SLogWriter | ( | ) |
Default destructor.
This is also one of the "don't do anything" destructors.
Definition at line 44 of file SLogWriter.cxx.
SLogWriter::SLogWriter | ( | ) | [protected] |
Protected default constructor.
The constructor takes care of filling the two std::map-s that are used for generating the nice colured output.
Definition at line 102 of file SLogWriter.cxx.
References ALWAYS, DEBUG, ERROR, FATAL, INFO, VERBOSE, and WARNING.
Referenced by Instance().
SMsgType SLogWriter::GetMinType | ( | ) | const |
Get the message type above which messages are printed.
Not much to say here.
Definition at line 93 of file SLogWriter.cxx.
Referenced by SLogger::operator<<().
SLogWriter * SLogWriter::Instance | ( | ) | [static] |
Function for accessing the single object.
This function implements the singleton design pattern for the class. Since the constructor of the class is "protected", the user can not create it manually. He/she has to access a (single) instance of the object with this function.
Definition at line 32 of file SLogWriter.cxx.
References SLogWriter().
Referenced by SCycleController::ExecuteNextCycle(), SCycleController::Initialize(), SLogger::operator=(), and SLogger::SLogger().
void SLogWriter::SetMinType | ( | SMsgType | type | ) |
Set the message type above which messages are printed.
This function sets the minimum message type that should still be displayed. All messages having a higher priority will be displayed as well of course.
type | The value of the minimum type |
Definition at line 82 of file SLogWriter.cxx.
Referenced by SCycleController::Initialize().
void SLogWriter::Write | ( | SMsgType | type, |
const std::string & | line | ||
) | const |
Function writing a message to the output.
This function is the heavy-lifter of the class. It writes the received message to the console. The function assumes that the message has no line breaks and that it has been formatted by SLogger.
type | The message type |
line | A single line of message to be displayed. |
Definition at line 56 of file SLogWriter.cxx.
Referenced by SLogger::Send().