sptk2 logo
SPTK Home Page

sptk::CSysLog Class Reference
[Log Classes]

A log stored in the system log. More...

#include <CSysLog.h>

Inheritance diagram for sptk::CSysLog:

sptk::CBaseLog sptk::CSynchronized

List of all members.

Public Member Functions

virtual void saveMessage (CDateTime date, const char *message, uint32_t sz, const CLogPriority *priority) throw (CException)
 Stores or sends log message to actual destination.
 CSysLog (uint32_t facilities=LOG_USER)
 Constructor.
virtual ~CSysLog ()
 Destructor.

Static Public Member Functions

static void programName (std::string progName)
 Sets program name.


Detailed Description

A log stored in the system log.

On *nix , the log is sent to *nix syslog daemon. On Windows NT/2000+/XP the log is sent to Event Log (Application). On Windows 95/98/ME the system log isn't supported.. The facility method allows to define - which system log is used

See also:
CBaseLog for more information about basic Log Classes abilities.

Constructor & Destructor Documentation

sptk::CSysLog::CSysLog ( uint32_t  facilities = LOG_USER  ) 

Constructor.

Creates a new log object based on the syslog facility (or facilities). For Windows, parameter facilities is ignored and messages are stored into Application event log

Parameters:
facilities int, log facility or a set of facilities.

virtual sptk::CSysLog::~CSysLog (  )  [virtual]

Destructor.

Destructs the log object, closes the log descriptor, releases all the allocated resources


Member Function Documentation

static void sptk::CSysLog::programName ( std::string  progName  )  [static]

Sets program name.

The program name is optional. It is set for all the CSysLog objects at once. If set, it appears in the log as a message prefix. Every time the program name is changed, the log is closed to be re-opened on next message.

Parameters:
progName std::string, a program name

virtual void sptk::CSysLog::saveMessage ( CDateTime  date,
const char *  message,
uint32_t  sz,
const CLogPriority priority 
) throw (CException) [virtual]

Stores or sends log message to actual destination.

This method should be overwritten by the actual log implementation

Parameters:
date CDateTime, message timestamp
message const char *, message text
sz uint32_t, message size
priority CLogPriority, message priority.
See also:
CLogPriority for more information.

Reimplemented from sptk::CBaseLog.


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

Mon Mar 5 11:56:07 2012: SPTK 3.5.7