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
 
QStringList msgHandlerEnabled () const
 Return names of the enabled message handlers. More...
 
bool msgHandlerEnabled (const QString &handlerName) const
 Return True if the handler identified by handlerName is enabled. 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

◆ Self

Definition at line 51 of file ctkErrorLogModel.h.

◆ Superclass

typedef QSortFilterProxyModel ctkErrorLogModel::Superclass

Definition at line 50 of file ctkErrorLogModel.h.

Member Enumeration Documentation

◆ ColumnsIds

Enumerator
TimeColumn 
ThreadIdColumn 
LogLevelColumn 
OriginColumn 
DescriptionColumn 
MaxColumn 

Definition at line 55 of file ctkErrorLogModel.h.

◆ ItemDataRole

Enumerator
DescriptionTextRole 

Definition at line 65 of file ctkErrorLogModel.h.

Constructor & Destructor Documentation

◆ ctkErrorLogModel()

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

◆ ~ctkErrorLogModel()

virtual ctkErrorLogModel::~ctkErrorLogModel ( )
virtual

Member Function Documentation

◆ addEntry

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

◆ asynchronousLogging()

bool ctkErrorLogModel::asynchronousLogging ( ) const

◆ clear

void ctkErrorLogModel::clear ( )
slot

Remove all log entries from model.

◆ disableAllMsgHandler()

void ctkErrorLogModel::disableAllMsgHandler ( )

◆ enableAllMsgHandler()

void ctkErrorLogModel::enableAllMsgHandler ( )

◆ entryAdded

void ctkErrorLogModel::entryAdded ( ctkErrorLogLevel::LogLevel  logLevel)
signal
See also
addEntry()

◆ fileLoggingEnabled()

bool ctkErrorLogModel::fileLoggingEnabled ( ) const

◆ fileLoggingPattern()

QString ctkErrorLogModel::fileLoggingPattern ( ) const

◆ filePath()

QString ctkErrorLogModel::filePath ( ) const

◆ filterEntry()

void ctkErrorLogModel::filterEntry ( const ctkErrorLogLevel::LogLevels &  logLevel = ctkErrorLogLevel::Unknown,
bool  disableFilter = false 
)

◆ logEntryCount()

Q_INVOKABLE int ctkErrorLogModel::logEntryCount ( ) const

Return current number of log entries.

See also
clear()

◆ logEntryData()

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

Return log entry information associated with row and column.

◆ logEntryDescription()

Q_INVOKABLE QString ctkErrorLogModel::logEntryDescription ( int  row) const

Return log entry information associated with Description column.

See also
ctkErrorLogModel::DescriptionColumn, logEntryData()

◆ logEntryGrouping()

bool ctkErrorLogModel::logEntryGrouping ( ) const

◆ logLevelFilter()

ctkErrorLogLevel::LogLevels ctkErrorLogModel::logLevelFilter ( ) const

◆ logLevelFilterChanged

void ctkErrorLogModel::logLevelFilterChanged ( )
signal

◆ msgHandlerEnabled() [1/2]

QStringList ctkErrorLogModel::msgHandlerEnabled ( ) const

Return names of the enabled message handlers.

◆ msgHandlerEnabled() [2/2]

bool ctkErrorLogModel::msgHandlerEnabled ( const QString &  handlerName) const

Return True if the handler identified by handlerName is enabled.

◆ msgHandlerNames()

QStringList ctkErrorLogModel::msgHandlerNames ( ) const

◆ numberOfFilesToKeep()

int ctkErrorLogModel::numberOfFilesToKeep ( ) const

◆ registerMsgHandler()

bool ctkErrorLogModel::registerMsgHandler ( ctkErrorLogAbstractMessageHandler msgHandler)

Register a message handler.

◆ setAllMsgHandlerEnabled()

void ctkErrorLogModel::setAllMsgHandlerEnabled ( bool  enabled)

◆ setAsynchronousLogging()

void ctkErrorLogModel::setAsynchronousLogging ( bool  value)

◆ setFileLoggingEnabled()

void ctkErrorLogModel::setFileLoggingEnabled ( bool  value)

◆ setFileLoggingPattern()

void ctkErrorLogModel::setFileLoggingPattern ( const QString &  value)

◆ setFilePath()

void ctkErrorLogModel::setFilePath ( const QString &  filePath)

◆ setLogEntryGrouping()

void ctkErrorLogModel::setLogEntryGrouping ( bool  value)

◆ setMsgHandlerEnabled() [1/2]

void ctkErrorLogModel::setMsgHandlerEnabled ( const QString &  handlerName,
bool  enabled 
)

Enable a specific handler given its name.

◆ setMsgHandlerEnabled() [2/2]

void ctkErrorLogModel::setMsgHandlerEnabled ( const QStringList &  handlerNames)

Enable handler identified by their names.

◆ setNumberOfFilesToKeep()

void ctkErrorLogModel::setNumberOfFilesToKeep ( int  value)

◆ setTerminalOutputs()

void ctkErrorLogModel::setTerminalOutputs ( const ctkErrorLogTerminalOutput::TerminalOutputs &  terminalOutput)

Set terminal output mode

See also
terminalOutputs()
TerminalOutput

◆ terminalOutputs()

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

◆ d_ptr

QScopedPointer<ctkErrorLogModelPrivate> ctkErrorLogModel::d_ptr
protected

Definition at line 152 of file ctkErrorLogModel.h.

Property Documentation

◆ asynchronousLogging

bool ctkErrorLogModel::asynchronousLogging
readwrite

Definition at line 1 of file ctkErrorLogModel.h.

◆ fileLoggingEnabled

bool ctkErrorLogModel::fileLoggingEnabled
readwrite

Definition at line 1 of file ctkErrorLogModel.h.

◆ fileLoggingPattern

QString ctkErrorLogModel::fileLoggingPattern
readwrite

Definition at line 1 of file ctkErrorLogModel.h.

◆ filePath

QString ctkErrorLogModel::filePath
readwrite

Definition at line 1 of file ctkErrorLogModel.h.

◆ logEntryGrouping

bool ctkErrorLogModel::logEntryGrouping
readwrite

Definition at line 1 of file ctkErrorLogModel.h.

◆ numberOfFilesToKeep

int ctkErrorLogModel::numberOfFilesToKeep
readwrite

Definition at line 1 of file ctkErrorLogModel.h.

◆ terminalOutputs

ctkErrorLogTerminalOutput::TerminalOutputs ctkErrorLogModel::terminalOutputs
readwrite

Definition at line 1 of file ctkErrorLogModel.h.


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