CSLLogger Class Reference

Simple message logging class. More...

#include <Logger.h>

List of all members.

Public Types

enum   ELogType {
  SI_LOG_INIT = 0,
  SI_LOG_FATAL,
  SI_LOG_ERROR,
  SI_LOG_WARNING,
  SI_LOG_VERBOSE,
  SI_LOG_TERM
}

Public Member Functions

  CSLLogger (SLLoggerCallBack OnInitFunc=StdOnInit, SLLoggerCallBack OnFatalFunc=StdOnFatal, SLLoggerCallBack OnErrorFunc=StdOnError, SLLoggerCallBack OnWarningFunc=StdOnWarning, SLLoggerCallBack OnVerboseFunc=StdOnVerbose, SLLoggerCallBack OnTermFunc=StdOnTerm, SI_Void *in_pUserData=0)
SI_Bool  Log (ELogType in_Type, SI_Void *in_pData)
SI_Void *  GetData ()
SI_Void *  SetData (SI_Void *in_pData)
SLLoggerCallBack  SetCallBack (ELogType in_Callback, SLLoggerCallBack in_NewCallback)
SLLoggerCallBack  GetCallBack (ELogType in_Callback)


Detailed Description

Simple message logging class.


Member Enumeration Documentation

enum ELogType

Defines the various types of messages that can be logged

Enumerator:
SI_LOG_INIT  Logging ininitalization callback
SI_LOG_FATAL  No hope for recovery
SI_LOG_ERROR  User needs to correct something before going any further
SI_LOG_WARNING  Some problems where found and have been corrected automatically
SI_LOG_VERBOSE  Informative message
SI_LOG_TERM  Logging termination callback


Constructor & Destructor Documentation

CSLLogger ( SLLoggerCallBack  OnInitFunc = StdOnInit,
SLLoggerCallBack  OnFatalFunc = StdOnFatal,
SLLoggerCallBack  OnErrorFunc = StdOnError,
SLLoggerCallBack  OnWarningFunc = StdOnWarning,
SLLoggerCallBack  OnVerboseFunc = StdOnVerbose,
SLLoggerCallBack  OnTermFunc = StdOnTerm,
SI_Void *  in_pUserData = 0  
)

Logs SL-related information

Parameters:
OnInitFunc  Callback used to initialize logging
OnFatalFunc  Callback that reports fatal errors
OnErrorFunc  Callback that reports errors
OnWarningFunc  Callback that reports warnings
OnVerboseFunc  Callback that reports general information
OnTermFunc  Callback used to oninitialize logging
in_pUserData  Pointer to user-supplied data (won't be freed by destructor)


Member Function Documentation

SI_Bool Log ( ELogType  in_Type,
SI_Void *  in_pData  
)

Logs a message

Note:
This function dispatches the message to the appropriate callback
Parameters:
in_Type  Type of message being sent
in_pData  Data that will be used by the callback

SI_Void* GetData (  ) 

Returns the internally stored user defined data

SI_Void* SetData ( SI_Void *  in_pData  ) 

Sets the internally stored user defined data

Parameters:
in_pData  New user defined data to store
Returns:
SI_Void* Former user defined data

SLLoggerCallBack SetCallBack ( ELogType  in_Callback,
SLLoggerCallBack  in_NewCallback  
)

Replaces a callback with a new one

Parameters:
in_Callback  Type of callback to replace
in_NewCallback  The new callback to use
Returns:
SLLoggerCallBack Pointer to the former callback

SLLoggerCallBack GetCallBack ( ELogType  in_Callback  ) 

Returns the current callback

Parameters:
in_Callback  Type of the callback to retrieve
Returns:
SLLoggerCallBack The callback


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