CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Public Types | Public Slots | Signals | Public Member Functions | Protected Attributes | Properties | List of all members
ctkErrorLogModel Class Reference

#include <Libs/Widgets/ctkErrorLogModel.h>

Inheritance diagram for ctkErrorLogModel:
Inheritance graph
[legend]
Collaboration diagram for ctkErrorLogModel:
Collaboration graph
[legend]

Public Types

enum  ColumnsIds {
  TimeColumn = 0, ThreadIdColumn, LogLevelColumn, OriginColumn,
  DescriptionColumn, MaxColumn = DescriptionColumn
}
 
enum  ItemDataRole { DescriptionTextRole = Qt::UserRole + 1 }
 
typedef ctkErrorLogModel Self
 
typedef QSortFilterProxyModel Superclass
 

Public Slots

void addEntry (const QDateTime &currentDateTime, const QString &threadId, ctkErrorLogLevel::LogLevel logLevel, const QString &origin, const ctkErrorLogContext &context, const QString &text)
 
void clear ()
 Remove all log entries from model. More...
 

Signals

void entryAdded (ctkErrorLogLevel::LogLevel logLevel)
 
void logLevelFilterChanged ()
 

Public Member Functions

bool asynchronousLogging () const
 
 ctkErrorLogModel (QObject *parentObject=0)
 
void disableAllMsgHandler ()
 
void enableAllMsgHandler ()
 
bool fileLoggingEnabled () const
 
QString fileLoggingPattern () const
 
QString filePath () const
 
void filterEntry (const ctkErrorLogLevel::LogLevels &logLevel=ctkErrorLogLevel::Unknown, bool disableFilter=false)
 
Q_INVOKABLE int logEntryCount () const
 
QVariant logEntryData (int row, int column=ctkErrorLogModel::DescriptionColumn, int role=Qt::DisplayRole) const
 
Q_INVOKABLE QString logEntryDescription (int row) const
 
bool logEntryGrouping () const
 
ctkErrorLogLevel::LogLevels logLevelFilter () const
 
bool msgHandlerEnabled (const QString &handlerName) const
 Return True if the handler identified by handlerName is enabled. More...
 
QStringList msgHandlerEnabled () const
 Return names of the enabled message handlers. More...
 
QStringList msgHandlerNames () const
 
int numberOfFilesToKeep () const
 
bool registerMsgHandler (ctkErrorLogAbstractMessageHandler *msgHandler)
 Register a message handler. More...
 
void setAllMsgHandlerEnabled (bool enabled)
 
void setAsynchronousLogging (bool value)
 
void setFileLoggingEnabled (bool value)
 
void setFileLoggingPattern (const QString &value)
 
void setFilePath (const QString &filePath)
 
void setLogEntryGrouping (bool value)
 
void setMsgHandlerEnabled (const QString &handlerName, bool enabled)
 Enable a specific handler given its name. More...
 
void setMsgHandlerEnabled (const QStringList &handlerNames)
 Enable handler identified by their names. More...
 
void setNumberOfFilesToKeep (int value)
 
void setTerminalOutputs (const ctkErrorLogTerminalOutput::TerminalOutputs &terminalOutput)
 
ctkErrorLogTerminalOutput::TerminalOutputs terminalOutputs () const
 
virtual ~ctkErrorLogModel ()
 

Protected Attributes

QScopedPointer< ctkErrorLogModelPrivate > d_ptr
 

Properties

bool asynchronousLogging
 
bool fileLoggingEnabled
 
QString fileLoggingPattern
 
QString filePath
 
bool logEntryGrouping
 
int numberOfFilesToKeep
 
ctkErrorLogTerminalOutput::TerminalOutputs terminalOutputs
 

Detailed Description

Definition at line 39 of file ctkErrorLogModel.h.

Member Typedef Documentation

Definition at line 51 of file ctkErrorLogModel.h.

typedef QSortFilterProxyModel ctkErrorLogModel::Superclass

Definition at line 50 of file ctkErrorLogModel.h.

Member Enumeration Documentation

Enumerator
TimeColumn 
ThreadIdColumn 
LogLevelColumn 
OriginColumn 
DescriptionColumn 
MaxColumn 

Definition at line 55 of file ctkErrorLogModel.h.

Enumerator
DescriptionTextRole 

Definition at line 65 of file ctkErrorLogModel.h.

Constructor & Destructor Documentation

ctkErrorLogModel::ctkErrorLogModel ( QObject *  parentObject = 0)
explicit
virtual ctkErrorLogModel::~ctkErrorLogModel ( )
virtual

Member Function Documentation

void ctkErrorLogModel::addEntry ( const QDateTime &  currentDateTime,
const QString &  threadId,
ctkErrorLogLevel::LogLevel  logLevel,
const QString &  origin,
const ctkErrorLogContext context,
const QString &  text 
)
slot
bool ctkErrorLogModel::asynchronousLogging ( ) const
void ctkErrorLogModel::clear ( )
slot

Remove all log entries from model.

void ctkErrorLogModel::disableAllMsgHandler ( )
void ctkErrorLogModel::enableAllMsgHandler ( )
void ctkErrorLogModel::entryAdded ( ctkErrorLogLevel::LogLevel  logLevel)
signal
See also
addEntry()
bool ctkErrorLogModel::fileLoggingEnabled ( ) const
QString ctkErrorLogModel::fileLoggingPattern ( ) const
QString ctkErrorLogModel::filePath ( ) const
void ctkErrorLogModel::filterEntry ( const ctkErrorLogLevel::LogLevels &  logLevel = ctkErrorLogLevel::Unknown,
bool  disableFilter = false 
)
Q_INVOKABLE int ctkErrorLogModel::logEntryCount ( ) const

Return current number of log entries.

See also
clear()
QVariant ctkErrorLogModel::logEntryData ( int  row,
int  column = ctkErrorLogModel::DescriptionColumn,
int  role = Qt::DisplayRole 
) const

Return log entry information associated with row and column.

Q_INVOKABLE QString ctkErrorLogModel::logEntryDescription ( int  row) const

Return log entry information associated with Description column.

See also
ctkErrorLogModel::DescriptionColumn, logEntryData()
bool ctkErrorLogModel::logEntryGrouping ( ) const
ctkErrorLogLevel::LogLevels ctkErrorLogModel::logLevelFilter ( ) const
void ctkErrorLogModel::logLevelFilterChanged ( )
signal
bool ctkErrorLogModel::msgHandlerEnabled ( const QString &  handlerName) const

Return True if the handler identified by handlerName is enabled.

QStringList ctkErrorLogModel::msgHandlerEnabled ( ) const

Return names of the enabled message handlers.

QStringList ctkErrorLogModel::msgHandlerNames ( ) const
int ctkErrorLogModel::numberOfFilesToKeep ( ) const
bool ctkErrorLogModel::registerMsgHandler ( ctkErrorLogAbstractMessageHandler msgHandler)

Register a message handler.

void ctkErrorLogModel::setAllMsgHandlerEnabled ( bool  enabled)
void ctkErrorLogModel::setAsynchronousLogging ( bool  value)
void ctkErrorLogModel::setFileLoggingEnabled ( bool  value)
void ctkErrorLogModel::setFileLoggingPattern ( const QString &  value)
void ctkErrorLogModel::setFilePath ( const QString &  filePath)
void ctkErrorLogModel::setLogEntryGrouping ( bool  value)
void ctkErrorLogModel::setMsgHandlerEnabled ( const QString &  handlerName,
bool  enabled 
)

Enable a specific handler given its name.

void ctkErrorLogModel::setMsgHandlerEnabled ( const QStringList &  handlerNames)

Enable handler identified by their names.

void ctkErrorLogModel::setNumberOfFilesToKeep ( int  value)
void ctkErrorLogModel::setTerminalOutputs ( const ctkErrorLogTerminalOutput::TerminalOutputs &  terminalOutput)

Set terminal output mode

See also
terminalOutputs()
TerminalOutput
ctkErrorLogTerminalOutput::TerminalOutputs ctkErrorLogModel::terminalOutputs ( ) const

Return if messages are both printed into the terminal and added to ctkErrorLogModel.

Note
If TerminalOutput::None is returned, message will only be added to the model.

Member Data Documentation

QScopedPointer<ctkErrorLogModelPrivate> ctkErrorLogModel::d_ptr
protected

Definition at line 152 of file ctkErrorLogModel.h.

Property Documentation

bool ctkErrorLogModel::asynchronousLogging
readwrite

Definition at line 44 of file ctkErrorLogModel.h.

bool ctkErrorLogModel::fileLoggingEnabled
readwrite

Definition at line 47 of file ctkErrorLogModel.h.

QString ctkErrorLogModel::fileLoggingPattern
readwrite

Definition at line 48 of file ctkErrorLogModel.h.

QString ctkErrorLogModel::filePath
readwrite

Definition at line 45 of file ctkErrorLogModel.h.

bool ctkErrorLogModel::logEntryGrouping
readwrite

Definition at line 42 of file ctkErrorLogModel.h.

int ctkErrorLogModel::numberOfFilesToKeep
readwrite

Definition at line 46 of file ctkErrorLogModel.h.

ctkErrorLogTerminalOutput::TerminalOutputs ctkErrorLogModel::terminalOutputs
readwrite

Definition at line 43 of file ctkErrorLogModel.h.


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