Drag[en]gine Game Engine  1.0
deLoggerConsoleColor Class Reference

Logs to the standard output stream (aka the console in most cases) using colors. More...

#include <deLoggerConsoleColor.h>

Inheritance diagram for deLoggerConsoleColor:
deLogger deObject

Public Types

enum  eTextAttributes {
  etaDefault, etaBright, etaDim, etaUnderline,
  etaBlink
}
 Text attributes. More...
 
enum  eTextColors {
  etcDefault, etcBlack, etcRed, etcGreen,
  etcYellow, etcBlue, etcMagenta, etcCyan,
  etcWhite
}
 Text colors. More...
 

Public Member Functions

Management
eTextAttributes GetInfoAttribute ()
 Info text attribute. More...
 
void SetInfoAttribute (eTextAttributes attribute)
 Set info text attribute. More...
 
eTextColors GetInfoColorForeground ()
 Info text foreground color. More...
 
void SetInfoColorForeground (eTextColors color)
 Set info text foreground color. More...
 
eTextColors GetInfoColorBackground ()
 Info text background color. More...
 
void SetInfoColorBackground (eTextColors color)
 Set info text background color. More...
 
eTextAttributes GetWarnAttribute ()
 Warn text attribute. More...
 
void SetWarnAttribute (eTextAttributes attribute)
 Set warn text attribute. More...
 
eTextColors GetWarnColorForeground ()
 Warn text foreground color. More...
 
void SetWarnColorForeground (eTextColors color)
 Set warn text foreground color. More...
 
eTextColors GetWarnColorBackground ()
 Warn text background color. More...
 
void SetWarnColorBackground (eTextColors color)
 Set warn text background color. More...
 
eTextAttributes GetErrorAttribute ()
 Error text attribute. More...
 
void SetErrorAttribute (eTextAttributes attribute)
 Set error text attribute. More...
 
eTextColors GetErrorColorForeground ()
 Error text foreground color. More...
 
void SetErrorColorForeground (eTextColors color)
 Set error text foreground color. More...
 
eTextColors GetErrorColorBackground ()
 Error text background color. More...
 
void SetErrorColorBackground (eTextColors color)
 Set error text background color. More...
 
virtual void LogInfo (const char *source, const char *message)
 Log information message. More...
 
virtual void LogWarn (const char *source, const char *message)
 Log warning message. More...
 
virtual void LogError (const char *source, const char *message)
 Log error message. More...
 
- Public Member Functions inherited from deLogger
virtual void LogInfoFormat (const char *source, const char *message,...)
 Log formatted information message. More...
 
virtual void LogInfoFormatUsing (const char *source, const char *message, va_list args)
 Log formatted information message. More...
 
virtual void LogWarnFormat (const char *source, const char *message,...)
 Log formated warning message. More...
 
virtual void LogWarnFormatUsing (const char *source, const char *message, va_list args)
 Log formated warning message. More...
 
virtual void LogErrorFormat (const char *source, const char *message,...)
 Log formated error message. More...
 
virtual void LogErrorFormatUsing (const char *source, const char *message, va_list args)
 Log formated error message. More...
 
virtual void LogException (const char *source, const deException &exception)
 Log exception error message. More...
 
 deLogger ()
 Creates logger. More...
 
- Public Member Functions inherited from deObject
int GetRefCount () const
 Reference count. More...
 
void AddReference ()
 Add reference increasing reference count by 1. More...
 
void FreeReference ()
 Decrease reference count by one and delete object if count reaches 0. More...
 
 deObject ()
 Create object with reference count of 1. More...
 

Protected Member Functions

deMutexGetMutex ()
 
void pPrintMessage (const char *source, const char *message, eTextAttributes attribute, eTextColors colorForeground, eTextColors colorBackground, char lineEnd) const
 Print message to console using color codes. More...
 
- Protected Member Functions inherited from deLogger
virtual ~deLogger ()
 Clean up logger. More...
 
- Protected Member Functions inherited from deObject
virtual ~deObject ()
 Clean up object. More...
 

Constructors and Destructors

 deLoggerConsoleColor ()
 Create console color logger. More...
 
virtual ~deLoggerConsoleColor ()
 Clean up console color logger. More...
 

Detailed Description

Logs to the standard output stream (aka the console in most cases) using colors.

In contrary to LogConsole this class supports using text attributes and text color codes to hilight info, warning and error log entries better. The used coloring can be adjusted.

Note
Logger color console is thread safe.

Member Enumeration Documentation

◆ eTextAttributes

Text attributes.

Enumerator
etaDefault 
etaBright 
etaDim 
etaUnderline 
etaBlink 

◆ eTextColors

Text colors.

Enumerator
etcDefault 
etcBlack 
etcRed 
etcGreen 
etcYellow 
etcBlue 
etcMagenta 
etcCyan 
etcWhite 

Constructor & Destructor Documentation

◆ deLoggerConsoleColor()

deLoggerConsoleColor::deLoggerConsoleColor ( )

Create console color logger.

◆ ~deLoggerConsoleColor()

virtual deLoggerConsoleColor::~deLoggerConsoleColor ( )
protectedvirtual

Clean up console color logger.

Member Function Documentation

◆ GetErrorAttribute()

eTextAttributes deLoggerConsoleColor::GetErrorAttribute ( )

Error text attribute.

◆ GetErrorColorBackground()

eTextColors deLoggerConsoleColor::GetErrorColorBackground ( )

Error text background color.

◆ GetErrorColorForeground()

eTextColors deLoggerConsoleColor::GetErrorColorForeground ( )

Error text foreground color.

◆ GetInfoAttribute()

eTextAttributes deLoggerConsoleColor::GetInfoAttribute ( )

Info text attribute.

◆ GetInfoColorBackground()

eTextColors deLoggerConsoleColor::GetInfoColorBackground ( )

Info text background color.

◆ GetInfoColorForeground()

eTextColors deLoggerConsoleColor::GetInfoColorForeground ( )

Info text foreground color.

◆ GetMutex()

deMutex& deLoggerConsoleColor::GetMutex ( )
inlineprotected

◆ GetWarnAttribute()

eTextAttributes deLoggerConsoleColor::GetWarnAttribute ( )

Warn text attribute.

◆ GetWarnColorBackground()

eTextColors deLoggerConsoleColor::GetWarnColorBackground ( )

Warn text background color.

◆ GetWarnColorForeground()

eTextColors deLoggerConsoleColor::GetWarnColorForeground ( )

Warn text foreground color.

◆ LogError()

virtual void deLoggerConsoleColor::LogError ( const char *  source,
const char *  message 
)
virtual

Log error message.

Reimplemented from deLogger.

◆ LogInfo()

virtual void deLoggerConsoleColor::LogInfo ( const char *  source,
const char *  message 
)
virtual

Log information message.

Reimplemented from deLogger.

◆ LogWarn()

virtual void deLoggerConsoleColor::LogWarn ( const char *  source,
const char *  message 
)
virtual

Log warning message.

Reimplemented from deLogger.

◆ pPrintMessage()

void deLoggerConsoleColor::pPrintMessage ( const char *  source,
const char *  message,
eTextAttributes  attribute,
eTextColors  colorForeground,
eTextColors  colorBackground,
char  lineEnd 
) const
protected

Print message to console using color codes.

Note
This call is not thread safe.

◆ SetErrorAttribute()

void deLoggerConsoleColor::SetErrorAttribute ( eTextAttributes  attribute)

Set error text attribute.

◆ SetErrorColorBackground()

void deLoggerConsoleColor::SetErrorColorBackground ( eTextColors  color)

Set error text background color.

◆ SetErrorColorForeground()

void deLoggerConsoleColor::SetErrorColorForeground ( eTextColors  color)

Set error text foreground color.

◆ SetInfoAttribute()

void deLoggerConsoleColor::SetInfoAttribute ( eTextAttributes  attribute)

Set info text attribute.

◆ SetInfoColorBackground()

void deLoggerConsoleColor::SetInfoColorBackground ( eTextColors  color)

Set info text background color.

◆ SetInfoColorForeground()

void deLoggerConsoleColor::SetInfoColorForeground ( eTextColors  color)

Set info text foreground color.

◆ SetWarnAttribute()

void deLoggerConsoleColor::SetWarnAttribute ( eTextAttributes  attribute)

Set warn text attribute.

◆ SetWarnColorBackground()

void deLoggerConsoleColor::SetWarnColorBackground ( eTextColors  color)

Set warn text background color.

◆ SetWarnColorForeground()

void deLoggerConsoleColor::SetWarnColorForeground ( eTextColors  color)

Set warn text foreground color.


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