Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals

dcs::fee::FeeClientLogger Class Reference

#include <FeeClientLogger.hpp>


Detailed Description

This class represents the logger for the FeeClient-library.

Author:
Sebastian Bablok
Date:
2005-10-05


Public Member Functions

virtual ~FeeClientLogger ()
void createLogMessage (unsigned int type, char *origin, char *description) const
void setLogLevel (unsigned int lvl)
void relayLogEntry (MessageStruct *msgStruct) const
bool registerInterface (FeeClientLibInterface *interface)

Static Public Member Functions

FeeClientLoggergetLogger ()

Private Member Functions

 FeeClientLogger ()
bool checkLogLevel (unsigned int event) const

Private Attributes

unsigned int mLogLevel
FeeClientLibInterfacempInterface

Static Private Attributes

FeeClientLoggerpInstance = 0


Constructor & Destructor Documentation

FeeClientLogger::~FeeClientLogger  )  [virtual]
 

Destructor for the Logger.

dcs::fee::FeeClientLogger::FeeClientLogger  )  [inline, private]
 

Constructor for the Logger.


Member Function Documentation

bool dcs::fee::FeeClientLogger::checkLogLevel unsigned int  event  )  const [inline, private]
 

Checks the event - type to the current LogLevel for local messages.

If event - type is inside current LogLevel, the event will be announced, if not, no message will be send or logged (NO log file entry).

Parameters:
event type of the event.
Returns:
true, if event - type is inside current LogLevel, else false.

void FeeClientLogger::createLogMessage unsigned int  type,
char *  origin,
char *  description
const
 

Prepares a logging message for sending it to a registered handler routine.

Parameters:
type the event type of this message
origin the source of this message
description the message body

FeeClientLogger * FeeClientLogger::getLogger  )  [static]
 

Method to create/get the single Logger - object (Singleton).

This method takes care, that only one Logger - object is created at one time. If this object already exists, it returns the pointer to this object (see also "Design Patterns, GoF, - Singleton). This function must be static, because it is called without having an Logger - object.

Returns:
pointer to the one and only Logger - object.

bool FeeClientLogger::registerInterface FeeClientLibInterface interface  ) 
 

This function registers the interface to the logger.

If an interface has already been registered, the new one is discarded.

Parameters:
interface pointer the FeeClientLibInterface
Returns:
false if an interface has already been registered

void FeeClientLogger::relayLogEntry MessageStruct msgStruct  )  const
 

Relays a log entry, which is received from a FeeServer.

The messages is checked against the log level delivered further in case of pass.

Parameters:
msgStruct pointer to the message struct storing the received log entry from the FeeServer.

void dcs::fee::FeeClientLogger::setLogLevel unsigned int  lvl  )  [inline]
 

Set the current log level.

It's a bit mask of

  • MSG_INFO
  • MSG_WARNING
  • MSG_ERROR
  • MSG_FAILURE_AUDIT
  • MSG_SUCCESS_AUDIT
  • MSG_DEBUG
  • MSG_ALARM The default value is MSG_INFO|MSG_WARNING|MSG_ERROR|MSG_ALARM


Field Documentation

unsigned int dcs::fee::FeeClientLogger::mLogLevel [private]
 

Current LogLevel (default level is "INFO|WARNING|ERROR|ALARM").

See also:
setLogLevel for more information about valid LogLevels.

FeeClientLibInterface* dcs::fee::FeeClientLogger::mpInterface [private]
 

Pointer to the FeeClientLibInterface to call the handler routine.

This interface has to be registered by the appropriated function.

FeeClientLogger * FeeClientLogger::pInstance = 0 [static, private]
 

This is the one and only Logger - object.

(see Singleton, GoF, Desing Patterns).


The documentation for this class was generated from the following files:
Generated on Thu Mar 29 19:21:15 2007 for Fee Client Library by doxygen 1.3.5