Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

# Keos::ILogger Class Reference

Abstract class for loggers. More...

`#include <KeosLogger.h>`

Inheritance diagram for Keos::ILogger:

List of all members.

## Public Member Functions

virtual | ~ILogger ()
| Destructor.

## Static Public Member Functions

static void | SetLogger (ILogger *pLogger)
| Change logger instance.
static void | Log (const char *strFormat,...)
| Log a message.

## Protected Member Functions

String | CurrentDate () const
| Return the current date.
String | CurrentTime () const
| Return the current time.

## Private Member Functions

virtual void | Write (const String &strMessage)=0
| Write a message, to redefine in the derived classes.

## Static Private Member Functions

static void | Destroy ()
| Destruct the logger instance.

## Static Private Attributes

static ILogger * | ms_pInstance = NULL
| Pointer on the current logger.

## Friends

class | CRoot

## Detailed Description

Abstract class for loggers.

Definition at line 33 of file KeosLogger.h.

## Constructor & Destructor Documentation

Keos::ILogger::~ILogger | ( |  | ) | `[virtual]`

| Destructor. Definition at line 35 of file KeosLogger.cpp.

## Member Function Documentation

String Keos::ILogger::CurrentDate | ( |  | ) | const`[protected]`

| Return the current date.

Returns:
  Current date in a string.

Definition at line 74 of file KeosLogger.cpp.

References CurrentTime().

Referenced by Keos::CLoggerFile::CLoggerFile().

String Keos::ILogger::CurrentTime | ( |  | ) | const`[protected]`

| Return the current time.

Returns:
  Current time in a string.

Definition at line 85 of file KeosLogger.cpp.

References CurrentTime().

Referenced by Keos::CLoggerFile::CLoggerFile(), CurrentDate(), CurrentTime(), Keos::CLoggerFile::Write(), and Keos::CLoggerFile::~CLoggerFile().

void Keos::ILogger::Destroy | ( |  | ) | `[static, private]`

| Destruct the logger instance. Definition at line 48 of file KeosLogger.cpp. References ms_pInstance. Referenced by SetLogger().

void Keos::ILogger::Log | ( | const char * | strFormat,
|  |  | ...
| ) | `[static]`

| Log a message.

Parameters:

  | strFormat | Format of the message.
  | ... | Optional parameters

Definition at line 55 of file KeosLogger.cpp.

References Assert, ms_pInstance, and Write().

void Keos::ILogger::SetLogger | ( | ILogger * | pLogger | ) | `[static]`

| Change logger instance. The instance past here will be destroyed by Logger, it must have dynamically been allocated.

Parameters:

  | pLogger | New logger.

Definition at line 41 of file KeosLogger.cpp.

References Destroy(), and ms_pInstance.

virtual void Keos::ILogger::Write | ( | const String & | strMessage | ) | `[private, pure virtual]`

| Write a message, to redefine in the derived classes.

Parameters:

  | strMessage | Message writes.

Implemented in Keos::CLoggerFile.

Referenced by Log().

## Friends And Related Function Documentation

friend class CRoot`[friend]`

| Definition at line 82 of file KeosLogger.h.

## Member Data Documentation

ILogger * Keos::ILogger::ms_pInstance = NULL`[static, private]`

| Pointer on the current logger. Definition at line 32 of file KeosLogger.cpp. Referenced by Destroy(), Log(), and SetLogger().

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

- KeosEngine/KeosLogger.h
- KeosEngine/KeosLogger.cpp