Public Types | Public Member Functions | Private Attributes

Logging::Handler Class Reference

#include <loggingHandler.h>

Inheritance diagram for Logging::Handler:
Inheritance graph
[legend]
Collaboration diagram for Logging::Handler:
Collaboration graph
[legend]

List of all members.

Public Types

typedef Loki::SmartPtr
< Handler,
Loki::RefCountedMTAdj
< Loki::ObjectLevelLockable >
::RefCountedMT,
Loki::AllowConversion,
Loki::NoCheck,
Loki::DefaultSPStorage > 
HandlerSmartPtr
 Handler smart pointer.

Public Member Functions

virtual ~Handler ()
Priority getLevel () const
void setLevel (Priority priority)
virtual void setLevels (Priority remotePriority, Priority localPriority, int type)
int getRemoteLevel ()
int getLocalLevel ()
void setRemoteLevel (Priority remotePriority)
void setLocalLevel (Priority localPriority)
void setRemoteLevelType (int type)
void setLocalLevelType (int type)
int getRemoteLevelType ()
int getLocalLevelType ()

Private Attributes

Priority priority_m
Priority localPriority_m
int priority_type_local_m
int priority_type_remote_m
Priority remotePriority_m

Detailed Description

A Handler object takes log messages from a Logger and exports them. It might for example, write them to a console or write them to a file, or send them to a network logging service, or forward them to an OS log, or whatever. A Handler can filter out certain log messages by using the setLevel method. This class is abstract as the developer must implement the log and getName methods inherited from BaseLog.


Member Typedef Documentation

typedef Loki::SmartPtr<Handler, Loki::RefCountedMTAdj<Loki::ObjectLevelLockable>::RefCountedMT, Loki::AllowConversion, Loki::NoCheck, Loki::DefaultSPStorage> Logging::Handler::HandlerSmartPtr

Handler smart pointer.


Constructor & Destructor Documentation

virtual Logging::Handler::~Handler (  )  [virtual]

Destructor


Member Function Documentation

Priority Logging::Handler::getLevel (  )  const [inline]

Get the log level specifying which messages will be logged by this Handler. Message levels lower than this level will be discarded.

Returns:
Current log level for this Handler.

References priority_m.

int Logging::Handler::getLocalLevel (  )  [inline]

References localPriority_m.

int Logging::Handler::getLocalLevelType (  )  [inline]

References priority_type_local_m.

int Logging::Handler::getRemoteLevel (  )  [inline]

References remotePriority_m.

int Logging::Handler::getRemoteLevelType (  )  [inline]
void Logging::Handler::setLevel ( Priority  priority  )  [inline]

By utilizing setLevel, one can filter out log messages entirely based on their priority. For example, calling setLevel(DEBUG) on a Handler would imply log messages with a lower priority such as TRACE would never be passed to the publish method.

Parameters:
priority New priority for this Handler
Returns:
void

References priority_m.

Referenced by setLevels().

virtual void Logging::Handler::setLevels ( Priority  remotePriority,
Priority  localPriority,
int  type 
) [inline, virtual]

Set levels for local and remote logging. It depends on the handler implementation (does it support only loca/remote or both) to handle the level. Default implementation sets localPriority.

See also:
setLevel()
Returns:
void

Reimplemented in Logging::LogSvcHandler.

References setLevel().

void Logging::Handler::setLocalLevel ( Priority  localPriority  )  [inline]

References localPriority_m.

void Logging::Handler::setLocalLevelType ( int  type  )  [inline]

References priority_type_local_m.

void Logging::Handler::setRemoteLevel ( Priority  remotePriority  )  [inline]

References remotePriority_m.

void Logging::Handler::setRemoteLevelType ( int  type  )  [inline]

Member Data Documentation

Local (stdout) priority.

Referenced by getLocalLevel(), and setLocalLevel().

Current priority that needs to be met before log messages are

sent to the publish method.

Referenced by getLevel(), and setLevel().

Remote priority.

Referenced by getRemoteLevel(), and setRemoteLevel().


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