#include <molequeue/logger.h>
Public Slots | |
static void | logEntry (MoleQueue::LogEntry &entry) |
static void | logEntry (LogEntry::LogEntryType type, const QString &message, const IdType &moleQueueId=InvalidId) |
static void | logDebugMessage (const QString &message, const IdType &moleQueueId=InvalidId) |
static void | logNotification (const QString &message, const IdType &moleQueueId=InvalidId) |
static void | logWarning (const QString &message, const IdType &moleQueueId=InvalidId) |
static void | logError (const QString &message, const IdType &moleQueueId=InvalidId) |
static void | setPrintDebugMessages (bool print) |
static void | setPrintNotifications (bool print) |
static void | setPrintWarnings (bool print) |
static void | setPrintErrors (bool print) |
static QLinkedList< LogEntry > | log () |
static void | setMaxEntries (int max) |
static void | clear () |
static void | resetNewErrorCount () |
static void | silenceNewErrors (bool silence=true) |
Signals | |
void | newDebugMessage (const MoleQueue::LogEntry &debug) |
void | newNotification (const MoleQueue::LogEntry ¬if) |
void | newWarning (const MoleQueue::LogEntry &warning) |
void | newError (const MoleQueue::LogEntry &error) |
void | newLogEntry (const MoleQueue::LogEntry &entry) |
void | firstNewErrorOccurred () |
void | newErrorCountReset () |
Static Public Member Functions | |
static Logger * | getInstance () |
static bool | printDebugMessages () |
static bool | printNotifications () |
static bool | printWarnings () |
static bool | printErrors () |
static int | maxEntries () |
static int | numNewErrors () |
Protected Slots | |
void | cleanUp () |
Manage log messages.
The singleton Logger class is used to handle log messages in MoleQueue. Log messages are represented as objects consisting of a user-friendly string, an enum value representing a subtype, and an optional MoleQueue id for any associated job.
There are four levels of log messages:
New log entries can be submitted using the static Logger::logEntry method or the convenient logDebugMessage, logNotification, logWarning, or logError. Each new log entry causes the newLogEntry signal to be emitted, as well as one of newDebugMessage, newNotification, newWarning, or newError, depending on the LogEntry type. Details of new log entries will be automatically sent to qDebug() if the print* methods are set to true (false by default).
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
signal |
Emitted when a new debugging message has been added to the log.
|
signal |
Emitted when a new notification has been added to the log.
|
signal |
Emitted when a new warning has been added to the log.
|
signal |
Emitted when a new error has been added to the log.
|
signal |
Emitted when any new log entry is added to the log.
|
signal |
Emitted when the new error count becomes non-zero. Monitor this to check for the presence of errors without getting notified about each error.
|
signal |
Emitted when the new error count is reset.
|
staticslot |
Add entry to the log.
|
staticslot |
Add a new log entry to the log.
|
staticslot |
Add a new debugging message to the log.
|
staticslot |
Add a new notification to the log.
|
staticslot |
Add a new warning to the log.
|
staticslot |
Add a new error to the log.
|
staticslot |
Whether or not to print debugging messages to qDebug. Default: false |
|
staticslot |
Whether or not to print notifications to qDebug. Default: false |
|
staticslot |
Whether or not to print warnings to qDebug. Default: false |
|
staticslot |
Whether or not to print errors to qDebug. Default: false |
|
staticslot |
|
staticslot |
max | The maximum number of entries the Logger will track. Default: 1000 |
|
staticslot |
Remove all entries from the log.
|
staticslot |
Reset the number of new errors.
|
staticslot |
silence | If true, the firstNewErrorOccurred signal will not be emitted until this function is called again with false. |