All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Types | Public Slots | Public Member Functions
Qtilities::CoreGui::WidgetLoggerEngine Class Reference

A logger engine which shows logged messages in a widget with a QPlainTextEdit widget. More...

#include <WidgetLoggerEngine.h>

Inheritance diagram for Qtilities::CoreGui::WidgetLoggerEngine:
Inheritance graph
[legend]

List of all members.

Public Types

enum  MessageDisplays {
  NoMessageDisplays = 0, AllMessagesPlainTextEdit = 1, IssuesPlainTextEdit = 2, WarningsPlainTextEdit = 4,
  ErrorsPlainTextEdit = 8
}
 This enumeration provides the possible ways that messages can be displayed in the WidgetLoggerEngineFrontend used by this engine. More...

Public Slots

void clearLog ()
 Clears the log currently hold by the logger engine.
void logMessage (const QString &message, Logger::MessageType message_type)
 Function which receives a formatted string which needs to be logged.
- Public Slots inherited from Qtilities::Logging::AbstractLoggerEngine
virtual void newMessages (const QString &engine_name, Logger::MessageType message_type, Logger::MessageContextFlags message_context, const QList< QVariant > &messages)
 Slot which is connected to the newMessage() signal of the Logger class.

Public Member Functions

QString description () const
 Returns a description of the engine.
void finalize ()
 Function which is called to finalize the logger engine.
bool initialize ()
 Function which is called to initialize the logger engine.
bool isFormattingEngineConstant () const
 Indicates if the formatting engine and/or the message contexts can be changed by the user at runtime.
bool isInitialized () const
 Returns true if the engine is initialized.
QPlainTextEdit * plainTextEdit (MessageDisplaysFlag message_display) const
 Returns the QPlainTextEdit used by this widget logger engine. Through this reference you can add your own custom syntax highligter etc.
void setWindowTitle (const QString &window_title)
 Sets the window title used for this logger engine.
QString status () const
 Returns a status message for the engine.
QString windowTitle () const
 Gets the window title used for this logger engine.
- Public Member Functions inherited from Qtilities::Logging::AbstractLoggerEngine
virtual void enableAllMessageTypes ()
 Enables all message types for this engine.
QString formattingEngineName ()
 Returns the name of the installed formatting engine.
Logger::MessageTypeFlags getEnabledMessageTypes () const
 Returns the enabled message types for this engine.
AbstractFormattingEnginegetInstalledFormattingEngine ()
 Returns a reference to the formatting engine used by this engine.
void installFormattingEngine (AbstractFormattingEngine *engine)
 Installs a formatting engine which needs to be used by this engine.
bool isActive () const
 Indicates if the engine is active.
Logger::MessageContextFlags messageContexts () const
 Returns the logging contexts for which this engine accepts messages.
QString name () const
 Returns the name of the engine.
virtual bool removable () const
 Gets if the user can remove this engine.
void setActive (bool is_active)
 Sets the activity of the engine.
virtual void setEnabledMessageTypes (Logger::MessageTypeFlags message_types)
 Sets the enabled message types for this engine.
void setMessageContexts (Logger::MessageContextFlags message_contexts)
 Sets the logging contexts for which this engine accepts messages.
void setName (const QString &name)
 Sets the name of the engine.
virtual void setRemovable (bool is_removable)
 Sets if the user can remove this engine.

Detailed Description

A logger engine which shows logged messages in a widget with a QPlainTextEdit widget.

A logger engine which shows logged messages in a widget with a QPlainTextEdit widget.

Note:
Clearing the log through clearLog() is supported by this logger engine.

Member Enumeration Documentation

This enumeration provides the possible ways that messages can be displayed in the WidgetLoggerEngineFrontend used by this engine.

The default is DefaultDisplays.

Note:
When only one message display is used in the engine, that display will not be tabbed.
Enumerator:
NoMessageDisplays 

No message displays.

AllMessagesPlainTextEdit 

Displays all messages under an "All Messages" tab using a QPlainTextEdit.

IssuesPlainTextEdit 

Displays all issues (warnings, errors etc.) under an "Issues" tab using a QPlainTextEdit.

WarningsPlainTextEdit 

Displays all warnings under a "Warnings" tab using a QPlainTextEdit.

ErrorsPlainTextEdit 

Displays all errors under a "Errors" tab using a QPlainTextEdit.


Member Function Documentation

void Qtilities::CoreGui::WidgetLoggerEngine::clearLog ( )
virtualslot

Clears the log currently hold by the logger engine.

Note:
This is not supported by all logger engines. See the class documentation of the logger engine you are interested in to see if it is supported.

Reimplemented from Qtilities::Logging::AbstractLoggerEngine.

void Qtilities::CoreGui::WidgetLoggerEngine::logMessage ( const QString &  message,
Logger::MessageType  message_type 
)
virtualslot

Function which receives a formatted string which needs to be logged.

Messages arrives at logger engines through the newMessages() slot which will format the messages and validate if they must be logged. If so, this function will be called with a formatted message. If you wish to handle the message formatting manually, you can reimplement the newMessages() function.

Implements Qtilities::Logging::AbstractLoggerEngine.

QPlainTextEdit * Qtilities::CoreGui::WidgetLoggerEngine::plainTextEdit ( MessageDisplaysFlag  message_display) const

Returns the QPlainTextEdit used by this widget logger engine. Through this reference you can add your own custom syntax highligter etc.

Note:
Only available when your MessageDisplayFlags includes MessagesPlainTextEdit.
void Qtilities::CoreGui::WidgetLoggerEngine::setWindowTitle ( const QString &  window_title)

Sets the window title used for this logger engine.

Note:
This function only does something usefull after the engine has been initialized.
QString Qtilities::CoreGui::WidgetLoggerEngine::windowTitle ( ) const

Gets the window title used for this logger engine.

Note:
This function only does something usefull after the engine has been initialized.


Qtilities : Reference Documentation Back to top Copyright © 2009-2013, Jaco Naudé