MessageLogMgr Class Reference

Manages reporting of status messages to a log file. More...

#include <MessageLogMgr.h>

Inheritance diagram for MessageLogMgr:

Inheritance graph

List of all members.

Public Member Functions

virtual void setPath (const std::string &path)=0
virtual MessageLogcreateLog (const std::string &logName)=0
virtual MessageLoggetLog (const std::string &logName) const =0
virtual MessageLoggetLog () const =0
virtual std::vector< MessageLog * > getLogs () const =0

Static Public Member Functions

static const std::string & signalLogPathChanged ()
static const std::string & signalLogAdded ()
static const std::string & signalLogRemoved ()

Protected Member Functions

virtual ~MessageLogMgr ()


Detailed Description

Manages reporting of status messages to a log file.

One technique of reporting messages to users is to generate a log file based on various processing events. This capability exists in the form of message logs that are maintained by the MessageLogMgr. Message logs are created according to a unique name, and there is no limit to the number of message logs for a session. All message logs are saved in a file on disk in a common message log directory set that is initially specified in the user options.

The MessageLogMgr class maintains the creation and management of each log and provides an interface to add a message to a single log.

A default log is automatically created for each user session. All messages with the reporting level of SILENT are also written to the session log. The session log has the filename "username_session.log", where "username" is the username of the person currently logged into the system.

This subclass of Subject will notify upon the following conditions:

See also:
MessageReportingLevel

Definition at line 50 of file MessageLogMgr.h.


Constructor & Destructor Documentation

virtual MessageLogMgr::~MessageLogMgr (  )  [protected, virtual]

This will be cleaned up during application close.

Plug-ins do not need to destroy it.

Definition at line 133 of file MessageLogMgr.h.


Member Function Documentation

static const std::string& MessageLogMgr::signalLogPathChanged (  )  [static]

Emitted when the message log path changes with boost::any<std::string> containing the new path.

Definition at line 57 of file MessageLogMgr.h.

static const std::string& MessageLogMgr::signalLogAdded (  )  [static]

Emitted when a new log is created by calling createLog() with boost::any<MessageLog*> containing a pointer to the created log.

Definition at line 64 of file MessageLogMgr.h.

static const std::string& MessageLogMgr::signalLogRemoved (  )  [static]

Emitted when a log is removed while closing a session with boost::any<MessageLog*> containing a pointer to the removed log.

Definition at line 71 of file MessageLogMgr.h.

virtual void MessageLogMgr::setPath ( const std::string &  path  )  [pure virtual]

Sets a new path for message logs.

This method sets a new directory to which all message logs are written. This should not normally be called, since the message log path is set by the user options.

Parameters:
path The new message log path.

virtual MessageLog* MessageLogMgr::createLog ( const std::string &  logName  )  [pure virtual]

Creates a new log with a given name.

Parameters:
logName The name of the new log to create.
Returns:
A pointer to the created log. A NULL pointer is returned if a log with the given name already exists.
See also:
getLog(const std::string&) const, getLog(), getLogs()

virtual MessageLog* MessageLogMgr::getLog ( const std::string &  logName  )  const [pure virtual]

Gets a handle to the specified log.

Parameters:
logName The name of the desired log.
Returns:
A pointer to the specified log.
See also:
getLog(), getLogs(), createLog()

virtual MessageLog* MessageLogMgr::getLog (  )  const [pure virtual]

Gets a handle to log associated with the current session.

Returns:
A pointer to the current log.
See also:
getLog(const std::string&) const, getLogs(), createLog()

virtual std::vector<MessageLog*> MessageLogMgr::getLogs (  )  const [pure virtual]

Gets handles for all managed logs.

Returns:
A vector of pointers to all managed logs.
See also:
getLog(const std::string&) const, getLog(), createLog()


Software Development Kit - Opticks 4.9.0 Build 16218