Workspace 6.21.5
Public Member Functions | List of all members
LogWorkflow Class Reference

LogStream subclass for directing a log stream to file. More...

#include <Tools/WorkflowValidation/BatchApplication/logworkflow.h>

Inheritance diagram for LogWorkflow:
[legend]

Public Member Functions

 LogWorkflow (const QString &workflow, bool ignoreRepeatedEntries, QStringList auditedLogs=QStringList(), QList< QPair< QString, QString > > auditedImages=QList< QPair< QString, QString > >())
 
 ~LogWorkflow () override
 
bool aborted () const
 
void flush () override
 
QStringList getAuditedLogs () const
 Returns a list of error messages that will be ignored if generated by this workflow (as set up in a workflow-analyse.config file)
 
QString getCurrentWorkflowName () const
 returns the name of the workflow being loaded or run
 
int getDebugCount () const
 Returns the number of LOG_DEBUG category log messages generated by the workflow.
 
int getDeprecatedCount () const
 Returns the number of LOG_DEPRECATED category log messages generated by the workflow.
 
QSet< QString > getDeprecatedWarnings () const
 Returns a list LOG_DEPRECATED category log messages generated by the workflow.
 
int getErrorCount () const
 Returns the number of LOG_ERROR category log messages generated by the workflow.
 
QStringList getErrors () const
 Returns a list LOG_ERROR category log messages generated by the workflow.
 
int getInfoCount () const
 Returns the number of LOG_INFO category log messages generated by the workflow.
 
QStringList getLocalLogs () const
 Returns a list category log messages generated either locally by this app or by the workflow but not under one of known log categories.
 
int getMessageCount () const
 Returns the total number of log messages generated by the workflow.
 
QStringList getMissingOutputs () const
 Returns a list of log messages that were expected to be generated by this workflow (as set up in a workflow-analyse.config file) but not found.
 
QSet< QString > getUniqueMessages () const
 Returns a list of unique log messages generated by the workflow. These are trimmed and converted to lowercase before comparison and output.
 
int getWarningCount () const
 Returns the number of LOG_WARNING category log messages generated by the workflow.
 
bool isStreamOkay () const override
 
void setAborted (bool aborted=true)
 
- Public Member Functions inherited from LogStream
virtual ~LogStream ()
 
virtual void flush ()=0
 
virtual bool isStreamOkay () const =0
 
void logText (const QString &msg, const QDateTime &timestamp)
 

Detailed Description

Because logging information is often needed as a diagnostic aid when developing operations, all calls to logText() are immediately followed by a call to flush(). This ensures that logged text is seen as soon as possible and it minimizes the chances of logged text being lost in the event of a crash.

Constructor & Destructor Documentation

◆ LogWorkflow()

LogWorkflow ( const QString &  workflow,
bool  ignoreRepeatedEntries,
QStringList  auditedLogs = QStringList(),
QList< QPair< QString, QString > >  auditedImages = QList<QPair<QString, QString>>() 
)

◆ ~LogWorkflow()

~LogWorkflow ( )
override

Member Function Documentation

◆ aborted()

bool aborted ( ) const

◆ flush()

void flush ( )
overridevirtual

Clients would not normally need to call this function, but if for some reason they want to be sure that all logged text has been sent to where it needs to go before performing some task, they can call flush(). When flush() returns, all underlying streams and buffers associated with the LogStream object will have been flushed to disk, etc.

Implements LogStream.

◆ getAuditedLogs()

QStringList getAuditedLogs ( ) const

◆ getCurrentWorkflowName()

QString getCurrentWorkflowName ( ) const

◆ getDebugCount()

int getDebugCount ( ) const

◆ getDeprecatedCount()

int getDeprecatedCount ( ) const

◆ getDeprecatedWarnings()

QSet< QString > getDeprecatedWarnings ( ) const

◆ getErrorCount()

int getErrorCount ( ) const

◆ getErrors()

QStringList getErrors ( ) const

◆ getInfoCount()

int getInfoCount ( ) const

◆ getLocalLogs()

QStringList getLocalLogs ( ) const

◆ getMessageCount()

int getMessageCount ( ) const

◆ getMissingOutputs()

QStringList getMissingOutputs ( ) const

◆ getUniqueMessages()

QSet< QString > getUniqueMessages ( ) const

◆ getWarningCount()

int getWarningCount ( ) const

◆ isStreamOkay()

bool isStreamOkay ( ) const
overridevirtual
Returns
True if the stream is able to accept text for writing.

Implements LogStream.

◆ setAborted()

void setAborted ( bool  aborted = true)