openikev2::Log Class Reference

This class allows to write log messages using several concrete implementations. More...

#include <log.h>

List of all members.

Public Types

enum  LOG_TYPE {
  LOG_NONE = 0x0000, LOG_INFO = 0x0001, LOG_MESG = 0x0002, LOG_STAT = 0x0004,
  LOG_CRYP = 0x0008, LOG_THRD = 0x0010, LOG_ERRO = 0x0020, LOG_ALRM = 0x0040,
  LOG_DHCP = 0x0080, LOG_IPSC = 0x0100, LOG_HALF = 0x0200, LOG_POLI = 0x0400,
  LOG_EBUS = 0x0800, LOG_CONF = 0x1000, LOG_WARN = 0x2000, LOG_ALL = 0xFFFF
}
 Log message types. More...

Static Public Member Functions

static string LOG_TYPE_STR (uint16_t type)
 Generates a textual representation of the LOG_TYPE enumeration values.
static void setImplementation (auto_ptr< LogImpl > implementation)
 Sets a specific log writer implementation to use.
static void setLogMask (uint16_t log_mask)
 Sets a mask to be applied when writes a log message.
static void showExtraInfo (bool extra)
 Indicates if extra information must be shown.
static void writeMessage (string who, string message, uint16_t type, bool main_info)
 Writes a log message to the log file.
static void writeLockedMessage (string who, string message, uint16_t type, bool main_info)
 Writes a log message to the log file, locking and unlocking the mutex.
static void open (string file_name)
 Open specified filename to write there log messages.
static void close ()
 Close log file.
static void acquire ()
 Locks log writer, avoiding simultaneous writings of several threads.
static void release ()
 Unlocks log writer.
static void writeMessage (IkeSaController &ike_sa_controller, string message, uint16_t type, bool main_info)
 Writes a log message to the log file, when the module is an IkeSaController.
static void writeLockedMessage (IkeSaController &ike_sa_controller, string message, uint16_t type, bool main_info)
 Writes a log message to the log file locking and unlocking the mutex, when the module is an IkeSaController.
static void writeMessage (Alarm &alarm, string message, uint16_t type, bool main_info)
 Writes a log message to the log file, when the module is an Alarm.
static void writeLockedMessage (Alarm &alarm, string message, uint16_t type, bool main_info)
 Writes a log message to the log file locking and unlocking the mutex, when the module is an Alarm.
static void writeMessage (ChildSa &childsa, string message, uint16_t type, bool main_info)
 Writes a log message to the log file, when the module is a ChildSa.
static void writeLockedMessage (ChildSa &childsa, string message, uint16_t type, bool main_info)
 Writes a log message to the log file locking and unlocking the mutex, when the module is a ChildSa.
static void writeMessage (IkeSaExecuter &ike_sa_executer, string message, uint16_t type, bool main_info)
 Writes a log message to the log file, when the module is an IkeSaExecuter.
static void writeLockedMessage (IkeSaExecuter &command_executer, string message, uint16_t type, bool main_info)
 Writes a log message to the log file locking and unlocking the mutex, when the module is an IkeSaExecuter.

Static Protected Attributes

static auto_ptr< LogImplimplementation
 Log writer implementation to be used.
static auto_ptr< Mutexlog_mutex
 Mutex_Posix to keep mutual exclusion.


Detailed Description

This class allows to write log messages using several concrete implementations.

Author:
Pedro J. Fernandez Ruiz, Alejandro Perez Mendez <pedroj.fernandez@dif.um.es, alejandro_perez@dif.um.es>


Member Enumeration Documentation

enum openikev2::Log::LOG_TYPE

Log message types.

Enumerator:
LOG_NONE  Write NONE.
LOG_INFO  Write informational messages.
LOG_MESG  Write IKE Message contents.
LOG_STAT  Write state machine transitions.
LOG_CRYP  Write generated cryptographical information (keys, shared secrests, .

..)

LOG_THRD  Write thread operation messages.
LOG_ERRO  Write exceptions.
LOG_ALRM  Write alarm events.
LOG_DHCP  Write DHCP client related events.
LOG_IPSC  Write IPSEC information.
LOG_HALF  Half open IKE SAs information.
LOG_POLI  Policies information.
LOG_EBUS  Event bus information.
LOG_CONF  Configuration information.
LOG_WARN  Warning information.
LOG_ALL  Write ALL.


Member Function Documentation

string openikev2::Log::LOG_TYPE_STR ( uint16_t  type  )  [static]

Generates a textual representation of the LOG_TYPE enumeration values.

Parameters:
type Log type
Returns:
Textual representation

void openikev2::Log::setImplementation ( auto_ptr< LogImpl implementation  )  [static]

Sets a specific log writer implementation to use.

Parameters:
implementation Log writer implementation

void openikev2::Log::setLogMask ( uint16_t  log_mask  )  [static]

Sets a mask to be applied when writes a log message.

Parameters:
log_mask Log mask

void openikev2::Log::showExtraInfo ( bool  extra  )  [static]

Indicates if extra information must be shown.

Parameters:
extra TRUE if extra information must be shown. FALSE otherwise.

void openikev2::Log::writeMessage ( string  who,
string  message,
uint16_t  type,
bool  main_info 
) [static]

Writes a log message to the log file.

Parameters:
who Module writting the message
message Log message to be writed
type Type of log message (Log::LOG_INFO, D_THRD, ...)
main_info Indicates if date must be writed

void openikev2::Log::writeLockedMessage ( string  who,
string  message,
uint16_t  type,
bool  main_info 
) [static]

Writes a log message to the log file, locking and unlocking the mutex.

Parameters:
who Module writting the message
message Log message to be writed
type Type of log message (Log::LOG_INFO, D_THRD, ...)
main_info Indicates if date must be writed

void openikev2::Log::open ( string  file_name  )  [static]

Open specified filename to write there log messages.

Parameters:
file_name Log file name

void openikev2::Log::writeMessage ( IkeSaController ike_sa_controller,
string  message,
uint16_t  type,
bool  main_info 
) [static]

Writes a log message to the log file, when the module is an IkeSaController.

Parameters:
ike_sa_controller IkeSaController writting the message
message Log message to be writed
type Type of log message (Log::LOG_INFO, D_THRD, ...)
main_info Indicates if date must be writed

void openikev2::Log::writeLockedMessage ( IkeSaController ike_sa_controller,
string  message,
uint16_t  type,
bool  main_info 
) [static]

Writes a log message to the log file locking and unlocking the mutex, when the module is an IkeSaController.

Parameters:
ike_sa_controller IkeSaController writting the message
message Log message to be writed
type Type of log message (Log::LOG_INFO, D_THRD, ...)
main_info Indicates if date must be writed

void openikev2::Log::writeMessage ( Alarm alarm,
string  message,
uint16_t  type,
bool  main_info 
) [static]

Writes a log message to the log file, when the module is an Alarm.

Parameters:
alarm Alarm writting the message
message Log message to be writed
type Type of log message (Log::LOG_INFO, D_THRD, ...)
main_info Indicates if date must be writed

void openikev2::Log::writeLockedMessage ( Alarm alarm,
string  message,
uint16_t  type,
bool  main_info 
) [static]

Writes a log message to the log file locking and unlocking the mutex, when the module is an Alarm.

Parameters:
alarm Alarm writting the message
message Log message to be writed
type Type of log message (Log::LOG_INFO, D_THRD, ...)
main_info Indicates if date must be writed

void openikev2::Log::writeMessage ( ChildSa childsa,
string  message,
uint16_t  type,
bool  main_info 
) [static]

Writes a log message to the log file, when the module is a ChildSa.

Parameters:
childsa ChildSa writting the message
message Log message to be writed
type Type of log message (Log::LOG_INFO, D_THRD, ...)
main_info Indicates if date must be writed

void openikev2::Log::writeLockedMessage ( ChildSa childsa,
string  message,
uint16_t  type,
bool  main_info 
) [static]

Writes a log message to the log file locking and unlocking the mutex, when the module is a ChildSa.

Parameters:
childsa ChildSa writting the message
message Log message to be writed
type Type of log message (Log::LOG_INFO, D_THRD, ...)
main_info Indicates if date must be writed

void openikev2::Log::writeMessage ( IkeSaExecuter ike_sa_executer,
string  message,
uint16_t  type,
bool  main_info 
) [static]

Writes a log message to the log file, when the module is an IkeSaExecuter.

Parameters:
ike_sa_executer IkeSaExecuter writting the message
message Log message to be writed
type Type of log message (Log::LOG_INFO, D_THRD, ...)
main_info Indicates if date must be writed

void openikev2::Log::writeLockedMessage ( IkeSaExecuter command_executer,
string  message,
uint16_t  type,
bool  main_info 
) [static]

Writes a log message to the log file locking and unlocking the mutex, when the module is an IkeSaExecuter.

Parameters:
ike_sa_executer IkeSaExecuter writting the message
message Log message to be writed
type Type of log message (Log::LOG_INFO, D_THRD, ...)
main_info Indicates if date must be writed


Generated on Fri Jul 27 11:04:51 2007 for libopenikev2 by  doxygen 1.5.1