forest-net
an overlay networks for large-scale virtual worlds
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
forest::Logger Class Reference

This is a very simple logger class to control the logging of error messages. More...

#include <Logger.h>

Public Member Functions

void setLevel (int)
 
void log (const string &s, int severity)
 Log message to standard output, based on severity. More...
 
void log (const string &s, int severity, Packet &p)
 
void log (const string &s, int severity, CtlPkt &cp)
 

Private Member Functions

void logit (const string &s, int severity)
 Log message to standard output, based on severity. More...
 
void logit (const string &s, int severity, Packet &p)
 
void logit (const string &s, int severity, CtlPkt &cp)
 

Private Attributes

int level
 severity level: 0 thru 3
 
pthread_mutex_t myLock
 to make all method calls thread-safe
 
char * tag [4]
 text description of severity levels used in error messages
 

Detailed Description

This is a very simple logger class to control the logging of error messages.

Definition at line 23 of file Logger.h.

Member Function Documentation

void forest::Logger::log ( const string &  s,
int  severity 
)
inline

Log message to standard output, based on severity.

Parameters
sis error message
severityis the severity level of the message
pis a reference to a packet whose contents is to be printed with the error message (optional argument)

Definition at line 35 of file Logger.h.

Here is the call graph for this function:

Here is the caller graph for this function:

void forest::Logger::logit ( const string &  s,
int  severity 
)
private

Log message to standard output, based on severity.

Parameters
sis error message
severityis the severity level of the message
pis a reference to a packet whose contents is to be printed with the error message (optional argument)

Definition at line 36 of file Logger.cpp.

Here is the caller graph for this function:


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