MsgLogger::MsgHandler Class Reference
[C++ Message Logging Facility]

#include <MsgHandler.h>

Inheritance diagram for MsgLogger::MsgHandler:

MsgLogger::MsgHandlerStdStreams List of all members.

Public Member Functions

virtual ~MsgHandler ()
virtual void setFormatter (MsgFormatter *formatter)
 attaches the formatter, will be owned by handler
virtual void setLevel (MsgLogLevel level)
 set the logger level, messages with the level below this won't be logged
virtual bool logging (MsgLogLevel sev) const
 check if the specified level will log any message
virtual bool log (const MsgLogRecord &record) const =0
 get the stream for the specified log level

Protected Member Functions

 MsgHandler ()
MsgFormatterformatter () const

Detailed Description

The base class for handling messages. Handling means dispatching messages to their final distantion, such as terminal, log file, external logging service, etc. Handlers like loggers have corresponding logging level which can be changed by clients. Default logging level for handlers is debug, which means they will log whatever loggers give them. For formatting the messages handlers use MsgFormatter class, clients can attach their own formatter objects to handlers, otherwise default formatter class will be used.

This software was developed for the BaBar collaboration. If you use all or part of it, please give an appropriate acknowledgement.

Copyright (C) 2005 SLAC

See also:
MsgLogger
Version:
Id
MsgHandler.h 2700 2011-12-09 21:52:07Z salnikov@SLAC.STANFORD.EDU
Author:
Andy Salnikov

Definition at line 82 of file MsgHandler.h.


Constructor & Destructor Documentation

MsgLogger::MsgHandler::~MsgHandler (  )  [virtual]

Definition at line 57 of file MsgHandler.cpp.

MsgLogger::MsgHandler::MsgHandler (  )  [protected]

Definition at line 50 of file MsgHandler.cpp.


Member Function Documentation

MsgFormatter & MsgLogger::MsgHandler::formatter (  )  const [protected]

Definition at line 86 of file MsgHandler.cpp.

Referenced by MsgLogger::MsgHandlerStdStreams::log(), and setFormatter().

virtual bool MsgLogger::MsgHandler::log ( const MsgLogRecord record  )  const [pure virtual]

get the stream for the specified log level

Implemented in MsgLogger::MsgHandlerStdStreams.

bool MsgLogger::MsgHandler::logging ( MsgLogLevel  sev  )  const [virtual]

check if the specified level will log any message

Definition at line 79 of file MsgHandler.cpp.

Referenced by MsgLogger::MsgHandlerStdStreams::log().

void MsgLogger::MsgHandler::setFormatter ( MsgFormatter formatter  )  [virtual]

attaches the formatter, will be owned by handler

Definition at line 64 of file MsgHandler.cpp.

References formatter().

void MsgLogger::MsgHandler::setLevel ( MsgLogLevel  level  )  [virtual]

set the logger level, messages with the level below this won't be logged

Definition at line 72 of file MsgHandler.cpp.


The documentation for this class was generated from the following files:
Generated on 19 Dec 2016 for PSANAclasses by  doxygen 1.4.7