Envision
A visual programming IDE for object-oriented languages
List of all members | Public Member Functions | Private Attributes | Static Private Attributes
Logger::DefaultLog Class Reference
Inheritance diagram for Logger::DefaultLog:
Logger::Log

Public Member Functions

 DefaultLog (QString requestingPluginId)
 
 ~DefaultLog ()
 
void add (Level level, QString message)
 Adds a new message with the specified level to the log. More...
 
void add (QString message)
 Adds a new message with LOGINFO level to the log. More...
 
LogEntry getNextEntry ()
 Returns the next unread message in the log queue. More...
 
QList< LogEntrygetUnreadEntries ()
 Returns a list of all unread messages in the log. More...
 
bool hasUnreadEntries ()
 Returns true if there are unread messages in the log. More...
 
- Public Member Functions inherited from Logger::Log
virtual ~Log ()
 
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...
 
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...
 

Private Attributes

int loggedEntriesSeen
 
QString pluginId
 

Static Private Attributes

static QMutex logAccess
 
static QVector< LogEntryloggedEvents
 

Additional Inherited Members

- Public Types inherited from Logger::Log
enum  Level { LOGDEBUG , LOGERROR , LOGWARNING , LOGINFO }
 The log levels to which each message can belong. More...
 
- Signals inherited from Logger::Log
void newLogEntry ()
 Emitted when a new log entry (or several) have been added to the log. More...
 
- Static Public Member Functions inherited from Logger::Log
static LoggetLogger (QString requestingPluginId)
 Returns an instance of the default logger that will be used to log events for the specified plugin. More...
 

Constructor & Destructor Documentation

◆ DefaultLog()

Logger::DefaultLog::DefaultLog ( QString  requestingPluginId)

◆ ~DefaultLog()

Logger::DefaultLog::~DefaultLog ( )

Member Function Documentation

◆ add() [1/2]

void Logger::DefaultLog::add ( Level  level,
QString  message 
)
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

Implements Logger::Log.

◆ add() [2/2]

void Logger::DefaultLog::add ( QString  message)
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

Implements Logger::Log.

◆ getNextEntry()

Log::LogEntry Logger::DefaultLog::getNextEntry ( )
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.

Implements Logger::Log.

◆ getUnreadEntries()

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

Returns a list of all unread messages in the log.

If there are no unread messages the list is empty.

Implements Logger::Log.

◆ hasUnreadEntries()

bool Logger::DefaultLog::hasUnreadEntries ( )
virtual

Returns true if there are unread messages in the log.

Implements Logger::Log.

Member Data Documentation

◆ logAccess

QMutex Logger::DefaultLog::logAccess
staticprivate

◆ loggedEntriesSeen

int Logger::DefaultLog::loggedEntriesSeen
private

◆ loggedEvents

QVector< Log::LogEntry > Logger::DefaultLog::loggedEvents
staticprivate

◆ pluginId

QString Logger::DefaultLog::pluginId
private