SFrame 3.6
SLogWriter Class Reference

Message writing class. More...

#include <core/include/SLogWriter.h>

Collaboration diagram for SLogWriter:

List of all members.

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 SLogWriterInstance ()
 Function for accessing the single object.

Protected Member Functions

 SLogWriter ()
 Protected default constructor.

Detailed Description

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...)

See also:
SLogger
Version:
Revision:
120

Definition at line 37 of file SLogWriter.h.


Constructor & Destructor Documentation

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().


Member Function Documentation

SMsgType SLogWriter::GetMinType ( ) const

Get the message type above which messages are printed.

Not much to say here.

See also:
SLogWriter::SetMinType

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.

Parameters:
typeThe value of the minimum type
See also:
SLogWriter::GetMinType

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.

Parameters:
typeThe message type
lineA single line of message to be displayed.

Definition at line 56 of file SLogWriter.cxx.

Referenced by SLogger::Send().


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