VHISTlib  1.84.0.3018
Public Types | Signals | Public Member Functions
vhist::LogSource Class Reference

A class which is a source for log messages. More...

#include <logsource.h>

Inheritance diagram for vhist::LogSource:
vhist::ArgfileReader vhist::ExtractionQueue vhist::StopWatch vhist::ValidationQueue vhist::VhistParser vhist::VhistRunner vhist::VhistaddRunner vhist::VhistdelRunner

List of all members.

Public Types

enum  LogType { LOG_MESSAGE, LOG_WARNING, LOG_ERROR }
 An enum defining different types of log messages. More...

Signals

void log (const QString msg, const int type=LOG_MESSAGE)
 This signal is emitted by the LogSource to publish a log message.

Public Member Functions

 LogSource (QObject *listener=NULL)
 Creates a new LogSource object and registers a listener with it.
virtual ~LogSource ()
 Destroys a LogSource object.
void publishToLogSlot (QObject *listener)
 Registers a listener with the LogSource object.
void publishToLogSignal (QObject *listener)
 Registers a listener with the LogSource object.

Detailed Description

A class which is a source for log messages.

The class provides an interface to register loggers, which want to be notified about log messages generated by this class as well as a signal to emit log messages. Each object which wants to register at a LogSource object to receive log messages must provide either a slot or signal with signature void log(const QString, const LogSource::LogType) or void log(const QString).


Member Enumeration Documentation

An enum defining different types of log messages.

A log message can describe an error, a warning or be a simple status message.

Enumerator:
LOG_MESSAGE 

The log message is a simple status message.

LOG_WARNING 

The log message is a warning.

LOG_ERROR 

The log message is an errormessage.


Constructor & Destructor Documentation

LogSource::LogSource ( QObject *  listener = NULL)

Creates a new LogSource object and registers a listener with it.

The listener must provide a slot with signature void log(const QString, const vhist::LogSource::LogType) or void log(const QString). The listener will receive all log messages generated by this class via the slot.

Parameters:
[in]listenerA class which should listen to the log messages of the LogSource object. Can be NULL, in which case no object is registered.

Member Function Documentation

void vhist::LogSource::log ( const QString  message,
const int  type = LOG_MESSAGE 
) [signal]

This signal is emitted by the LogSource to publish a log message.

The message has a type which tells whether its a simple message, a warning or an error.

Parameters:
[in]messageThe log message.
[in]typeThe type of the log message. Valid values are all values in the enum vhist::LogSource::LogType.
void LogSource::publishToLogSignal ( QObject *  listener)

Registers a listener with the LogSource object.

The listener must provide a signal with signature void log(const QString, const int) or void log(const QString). All log messages will be forwarded to this signal.

Parameters:
[in]listenerA class which should listen to the log messages of the LogSource object. Can be NULL, in which case no object is registered.
void LogSource::publishToLogSlot ( QObject *  listener)

Registers a listener with the LogSource object.

The listener must provide a slot with signature void log(const QString, const int) or void log(const QString). The listener will receive all log messages generated by this class via the slot.

Parameters:
[in]listenerA class which should listen to the log messages of the LogSource object. Can be NULL, in which case no object is registered.

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

VHISTlib 1.84.0.3018 of Jun 28 2013, generated by doxygen.