Envision
A visual programming IDE for object-oriented languages
List of all members | Classes | Public Types | Signals | Public Member Functions | Static Public Member Functions
Logger::Log Class Referenceabstract

The Log interface includes functionality for recording system events. More...

Inheritance diagram for Logger::Log:
Logger::DefaultLog

Classes

struct  LogEntry
 The information of each entry in the log. More...
 

Public Types

enum  Level { LOGDEBUG , LOGERROR , LOGWARNING , LOGINFO }
 The log levels to which each message can belong. More...
 

Signals

void newLogEntry ()
 Emitted when a new log entry (or several) have been added to the log. More...
 

Public Member Functions

virtual ~Log ()
 
virtual void add (Level level, QString message)=0
 Adds a new message with the specified level to the log. More...
 
virtual void add (QString message)=0
 Adds a new message with LOGINFO level to the log. More...
 
void debug (const QString &message)
 A convenience function that logs a new debug message to the log. More...
 
void error (const QString &message)
 A convenience function that adds a new error message to the log. More...
 
virtual LogEntry getNextEntry ()=0
 Returns the next unread message in the log queue. More...
 
virtual QList< LogEntrygetUnreadEntries ()=0
 Returns a list of all unread messages in the log. More...
 
virtual bool hasUnreadEntries ()=0
 Returns true if there are unread messages in the log. More...
 
void info (const QString &message)
 A convenience function that adds a new info message to the log. More...
 
void warning (const QString &message)
 A convenience function that adds a new warning message to the log. More...
 

Static Public Member Functions

static LoggetLogger (QString requestingPluginId)
 Returns an instance of the default logger that will be used to log events for the specified plugin. More...
 

Detailed Description

The Log interface includes functionality for recording system events.

Member Enumeration Documentation

◆ Level

The log levels to which each message can belong.

Enumerator
LOGDEBUG 
LOGERROR 
LOGWARNING 
LOGINFO 

Constructor & Destructor Documentation

◆ ~Log()

Logger::Log::~Log ( )
virtual

Member Function Documentation

◆ add() [1/2]

virtual void Logger::Log::add ( Level  level,
QString  message 
)
pure virtual

Adds a new message with the specified level to the log.

The plug-in id that will be associated with the message is determined by the Log object instance.

Parameters
levelThe log level of the message
messageThe message to add

Implemented in Logger::DefaultLog.

◆ add() [2/2]

virtual void Logger::Log::add ( QString  message)
pure virtual

Adds a new message with LOGINFO level to the log.

The plug-in id that will be associated with the message is determined by the Log object instance.

Parameters
messageThe message to add

Implemented in Logger::DefaultLog.

◆ debug()

void Logger::Log::debug ( const QString &  message)
inline

A convenience function that logs a new debug message to the log.

◆ error()

void Logger::Log::error ( const QString &  message)
inline

A convenience function that adds a new error message to the log.

◆ getLogger()

Log * Logger::Log::getLogger ( QString  requestingPluginId)
static

Returns an instance of the default logger that will be used to log events for the specified plugin.

Parameters
requestingPluginIdThe plug-in id that will be used when adding new messages to the log.

◆ getNextEntry()

virtual LogEntry Logger::Log::getNextEntry ( )
pure virtual

Returns the next unread message in the log queue.

This also advances the pointer of the last read message by one.

If there are no unread entries, returns an empty (default) LogEntry.

Implemented in Logger::DefaultLog.

◆ getUnreadEntries()

virtual QList<LogEntry> Logger::Log::getUnreadEntries ( )
pure virtual

Returns a list of all unread messages in the log.

If there are no unread messages the list is empty.

Implemented in Logger::DefaultLog.

◆ hasUnreadEntries()

virtual bool Logger::Log::hasUnreadEntries ( )
pure virtual

Returns true if there are unread messages in the log.

Implemented in Logger::DefaultLog.

◆ info()

void Logger::Log::info ( const QString &  message)
inline

A convenience function that adds a new info message to the log.

◆ newLogEntry

void Logger::Log::newLogEntry ( )
signal

Emitted when a new log entry (or several) have been added to the log.

◆ warning()

void Logger::Log::warning ( const QString &  message)
inline

A convenience function that adds a new warning message to the log.