MoleQueue  0.8.0
 All Classes Functions Variables Enumerations Enumerator Pages
Public Types | Public Member Functions | Protected Member Functions | List of all members
LogEntry Class Reference

#include <molequeue/logentry.h>

Public Types

enum  LogEntryType {
  DebugMessage = 0,
  Notification,
  Warning,
  Error
}
 

Public Member Functions

 LogEntry (LogEntryType type, const QString &message_, const IdType &moleQueueId_=InvalidId)
 
 LogEntry (const LogEntry &other)
 
virtual ~LogEntry ()
 
LogEntryType entryType () const
 
bool isEntryType (LogEntryType type) const
 
void setMessage (const QString &message_)
 
QString message () const
 
void setMoleQueueId (IdType moleQueueId_)
 
IdType moleQueueId () const
 
const QDateTime & timeStamp () const
 

Protected Member Functions

 LogEntry (const QJsonObject &json)
 
void writeSettings (QJsonObject &root) const
 
void setTimeStamp ()
 

Detailed Description

Message and metadata for log messages.

Author
David C. Lonie

Each LogEntry object represents an entry in the MoleQueue log. LogEntries fall into one of four categories:

The easiest way to add new entries to the log is to use the static functions in Logger:

Each LogEntry contains a user-friendly message, an LogEntryType to identify the type of log entry, an optional MoleQueue id for any associate Job, and a timestamp, which is set by the Logger when the entry is added.

See Also
Logger

Member Enumeration Documentation

Enumeration of different types of log entries.

Enumerator
DebugMessage 

Verbose debugging information.

Notification 

Routine information that is relevant to the user.

Warning 

Non-routine information that is relevant to the user, but does not indicate a serious problem.

Error 

Serious problem that will affect either the MoleQueue application or a Job's ability to perform properly.

Constructor & Destructor Documentation

LogEntry ( LogEntryType  type,
const QString &  message_,
const IdType &  moleQueueId_ = InvalidId 
)

LogEntry Construct a new log entry.

Parameters
typeType of log message.
message_Descriptive user-visible message for log.
moleQueueId_MoleQueue id of any associated job.
See Also
Logger::addDebugMessage
Logger::addNotification
Logger::addWarning
Logger::addError
LogEntry ( const LogEntry other)

Copy the LogEntry other into a new LogEntry.

virtual ~LogEntry ( )
virtual

Destroy the log entry.

LogEntry ( const QJsonObject &  json)
protected

Initialize from data in the QJsonObject.

Member Function Documentation

LogEntryType entryType ( ) const
Returns
The type of log message.
bool isEntryType ( LogEntryType  type) const
Returns
True if this message has type type.
void setMessage ( const QString &  message_)

A user-friendly log message.

QString message ( ) const

A user-friendly log message.

void setMoleQueueId ( IdType  moleQueueId_)

The MoleQueue id of the associated job (if any, InvalidId otherwise).

IdType moleQueueId ( ) const

The MoleQueue id of the associated job (if any, InvalidId otherwise).

void writeSettings ( QJsonObject &  root) const
protected

Write this entry's settings to the QJsonObject.

void setTimeStamp ( )
protected

Set the timestamp on this LogEntry to the current time.


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