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

ztt::dcs::Logger Class Reference

#include <Logger.hpp>

List of all members.


Detailed Description

Logger class, controlles all kind s of logging mechanisms of the interCom - Layer. It provides the FedMessenger with logging - messages. IT will take care of the different levels of logging, the different places, where messages will be stored. It also writes entries to a logfile (logfile name: "InterCom.log".

Date:
23-12-2003
Author:
Sebastian Bablok, Benjamin Schockert


Public Member Functions

virtual ~Logger ()
void createLogMessage (unsigned int type, char *origin, char *description) const
void relayLogEntry (MessageStruct *msgStruct) const
void setLogLevel (unsigned int logLevel)
void setRemoteLogLevel (unsigned int remoteLogLevel)
unsigned int getLogLevel ()
unsigned int getRemoteLogLevel ()

Static Public Member Functions

LoggercreateLogger (FedMessenger *pMessenger)
const LoggergetLogger ()


Constructor & Destructor Documentation

virtual ztt::dcs::Logger::~Logger  )  [virtual]
 

Destructor for Logger and writes a logfile entry about shuting down the InterCom - Layer (Exception: no check for the LogLevel will be done here).


Member Function Documentation

Logger* ztt::dcs::Logger::createLogger FedMessenger pMessenger  )  [static]
 

Method to create a 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. ??? maybe use smart - pointer here to take care of the logger !!!

Parameters:
pMessenger pointer to the FedMessenger, which informs the upper layers about messages.
Returns:
pointer to the one and only Logger - object.

void ztt::dcs::Logger::createLogMessage unsigned int  type,
char *  origin,
char *  description
const
 

Prepares a logging message for sending it to the FedClient via FedMessenger and writes it also to the logfile, if possible.

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

const Logger * ztt::dcs::Logger::getLogger  )  [inline, static]
 

Function to get the Logger from "outside". If Logger - objects has not been created yet, an exception is thrown.

Returns:
pointer to the one and only Logger - object, if created.
Exceptions:
Nullpointer exception, if no Logger obejcts has been created yet.

unsigned int ztt::dcs::Logger::getLogLevel  ) 
 

Getter for the current LogLevel (local), used for unit tests.

Returns:
current LogLevel (local)

unsigned int ztt::dcs::Logger::getRemoteLogLevel  ) 
 

Getter for the current remote LogLevel, used for unit tests.

Returns:
current RemoteLogLevel

void ztt::dcs::Logger::relayLogEntry MessageStruct msgStruct  )  const
 

Relays a log entry, which is received from a FeeServer. The messages is checked against the remote log level (for the FeeServer messages), if this fails, they are at least written to the log file, else they are delivered further.

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

void ztt::dcs::Logger::setLogLevel unsigned int  logLevel  ) 
 

Setter for the LogLevel (localy created events). A check for a valid LogLevel value is also done (if not valid, a message is send). [NOTE: The log level Msg_Alarm is always set!) A valid LogLevel can be any combination of:

  • INFO [1]
  • WARNING [2]
  • ERROR [4]
  • FAILURE AUDIT [8]
  • SUCCESS AUDIT [16]
  • DEBUG [32]
  • ALARM [64]

See also:
FedMessenger for more details about LogLevels.
Parameters:
logLevel the desired logLevel.

void ztt::dcs::Logger::setRemoteLogLevel unsigned int  remoteLogLevel  ) 
 

Setter for the LogLevel of remote events. A check for a valid remote LogLevel value is also done (if not valid, a message is send). [NOTE: The log level Msg_Alarm is always set!) A valid LogLevel can be any combination of:

  • INFO [1]
  • WARNING [2]
  • ERROR [4]
  • FAILURE AUDIT [8]
  • SUCCESS AUDIT [16]
  • DEBUG [32]
  • ALARM [64]

See also:
FedMessenger for more details about LogLevels.
Parameters:
remoteLogLevel the desired logLevel for further delivery of remote events.


The documentation for this class was generated from the following file:
Generated on Fri Mar 30 02:54:34 2007 for InterComLayer by doxygen 1.3.5