sptk2 logo
SPTK Home Page

sptk::CProxyLog Class Reference
[Log Classes]

A log that sends all the log messages into another log. More...

#include <CProxyLog.h>

Inheritance diagram for sptk::CProxyLog:

sptk::CBaseLog sptk::CSynchronized

List of all members.

Public Member Functions

 CProxyLog (CBaseLog &destination)
 Constructor.
virtual void reset () throw (CException)
 Restarts the log.
virtual const CLogPrioritydefaultPriority () const
 Returns the default priority.
virtual const CLogPriorityminPriority () const
 Returns the min priority.

Protected Member Functions

virtual void defaultPriority (CLogPriority &priority)
 The actual log to store messages to (destination log).
virtual void minPriority (const CLogPriority &prt)
 Sets min message priority.
virtual void saveMessage (CDateTime date, const char *message, uint32_t sz, const CLogPriority *priority) throw (CException)
 Sends log message to actual destination.


Detailed Description

A log that sends all the log messages into another log.

The destination log is locked for a message adding period. Multiple CProxyLog objects may send messages from different threads into the same destination log. The log options defining message format and min priority are used from destination log.

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

Constructor & Destructor Documentation

sptk::CProxyLog::CProxyLog ( CBaseLog destination  )  [inline]

Constructor.

Creates a new log object based on the file name. If this file doesn't exist - it will be created.

Parameters:
destination CBaseLog&, destination log object


Member Function Documentation

virtual const CLogPriority& sptk::CProxyLog::defaultPriority (  )  const [inline, virtual]

Returns the default priority.

The default priority is used for the new message, if you are not defining priority.

Reimplemented from sptk::CBaseLog.

References sptk::CBaseLog::defaultPriority().

virtual void sptk::CProxyLog::defaultPriority ( CLogPriority priority  )  [inline, protected, virtual]

The actual log to store messages to (destination log).

Sets the default priority Does nothing since the priority should be defined for the shared (parent) log object

Parameters:
priority CLogPriority&, new default priority

Reimplemented from sptk::CBaseLog.

virtual const CLogPriority& sptk::CProxyLog::minPriority (  )  const [inline, virtual]

Returns the min priority.

Messages with priority less than requested are ignored

Reimplemented from sptk::CBaseLog.

References sptk::CBaseLog::minPriority().

virtual void sptk::CProxyLog::minPriority ( const CLogPriority prt  )  [inline, protected, virtual]

Sets min message priority.

Does nothing since the min message priority should be defined for the shared (parent) log object

Parameters:
prt const CLogPriority&, min message priority

Reimplemented from sptk::CBaseLog.

virtual void sptk::CProxyLog::reset (  )  throw (CException) [virtual]

Restarts the log.

The current log content is cleared. The file is recreated.

Reimplemented from sptk::CBaseLog.

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

Sends log message to actual destination.

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:06 2012: SPTK 3.5.7