Workspace 6.21.5
Public Types | Public Member Functions | Protected Member Functions | List of all members
Logger Class Reference

#include <Workspace/Core/AppWide/logger.h>

Inheritance diagram for Logger:
[legend]

Public Types

enum  Styles { Warning , Error , Preformat }
 

Public Member Functions

 Logger ()
 The default constructor logs to standard output with a plain text log mode.
 
 Logger (const Logger &logger)
 
virtual ~Logger ()
 We own the log mode, so delete it.
 
std::string ErrorOff () const
 
std::string ErrorOn () const
 
std::ostream & GetLog () const
 
const LogModeGetLogMode () const
 
void SetLog (std::ostream &log)
 
void SetLogMode (const LogMode &logMode)
 
void SetLogModeHTML ()
 
void SetLogModePlainText ()
 Set log mode to plain text output.
 
template<Styles s>
void StyleOff () const
 
template<Styles s>
void StyleOn () const
 
std::string WarningOff () const
 
std::string WarningOn () const
 

Protected Member Functions

virtual void LogChanged ()
 
virtual void LogModeChanged ()
 

Member Enumeration Documentation

◆ Styles

enum Styles
Enumerator
Warning 
Error 
Preformat 

Constructor & Destructor Documentation

◆ Logger() [1/2]

Logger ( )

◆ Logger() [2/2]

Logger ( const Logger logger)

The copy constructor must clone the log mode, since we own it and can't share the log mode object with logger.

◆ ~Logger()

~Logger ( )
virtual

Member Function Documentation

◆ ErrorOff()

std::string ErrorOff ( ) const

◆ ErrorOn()

std::string ErrorOn ( ) const

◆ GetLog()

std::ostream & GetLog ( ) const
Returns
The log stream currently in effect for this object. Use this in place of std::cout for all logging in the subclass.

◆ GetLogMode()

const LogMode & GetLogMode ( ) const
Returns
The log mode object that controls the style of text for various things like ErrorOn(), etc. It should only be used for passing to SetLogMode(LogMode*).

◆ LogChanged()

virtual void LogChanged ( )
inlineprotectedvirtual

◆ LogModeChanged()

virtual void LogModeChanged ( )
inlineprotectedvirtual

◆ SetLog()

void SetLog ( std::ostream &  log)

Set the log stream to log. Subclasses may override LogChanged() to implement their own handling of log messages, since this function is called as the last thing SetLog does before returning.

◆ SetLogMode()

void SetLogMode ( const LogMode logMode)

Set log mode to the same as logMode. Note that logMode is not used directly, but a copy is taken of it for internal use. Subclasses may override LogModeChanged() to implement their own handling of log messages, since this function is called as the last thing SetLogMode does before returning.

◆ SetLogModeHTML()

void SetLogModeHTML ( )

Set log mode to HTML output. Some tags will be inserted around warning and error messages.

◆ SetLogModePlainText()

void SetLogModePlainText ( )

◆ StyleOff()

void StyleOff ( ) const

◆ StyleOn()

void StyleOn ( ) const

◆ WarningOff()

std::string WarningOff ( ) const

◆ WarningOn()

std::string WarningOn ( ) const