TreeFrogFramework  1.29
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
TLogger Class Referenceabstract

#include <tlogger.h>

Inheritance diagram for TLogger:
Inheritance graph
[legend]

Public Member Functions

 TLogger ()
 
virtual ~TLogger ()
 
virtual QString key () const =0
 
virtual bool isMultiProcessSafe () const =0
 
virtual bool open ()=0
 
virtual void close ()=0
 
virtual bool isOpen () const =0
 
virtual void log (const TLog &log)=0
 
virtual void log (const QByteArray &)
 
virtual void flush ()
 
virtual QByteArray logToByteArray (const TLog &log) const
 
const QByteArray & layout () const
 
const QByteArray & dateTimeFormat () const
 
Tf::LogPriority threshold () const
 
const QString & target () const
 

Static Public Member Functions

static QByteArray logToByteArray (const TLog &log, const QByteArray &layout, const QByteArray &dateTimeFormat, QTextCodec *codec=0)
 
static QByteArray priorityToString (Tf::LogPriority priority)
 

Protected Member Functions

QTextCodec * codec () const
 
QVariant settingsValue (const QString &key, const QVariant &defaultValue=QVariant()) const
 

Detailed Description

The TLogger class provides an abstract base of logging functionality.

Constructor & Destructor Documentation

◆ TLogger()

TLogger::TLogger ( )

Constructor.

◆ ~TLogger()

virtual TLogger::~TLogger ( )
inlinevirtual

Member Function Documentation

◆ close()

void TLogger::close ( )
pure virtual

Closes the device. This function should be called from any reimplementations of close().

Implemented in TFileAioLogger.

◆ codec()

QTextCodec * TLogger::codec ( ) const
protected

Returns a pointer to QTextCodec of the default text encoding.

◆ dateTimeFormat()

const QByteArray & TLogger::dateTimeFormat ( ) const

Returns a reference to the value for the setting datetime format.

◆ flush()

void TLogger::flush ( )
inlinevirtual

Flushes any buffered data to the device. This function should be called from any reimplementations of flush().

Reimplemented in TFileAioLogger.

◆ isMultiProcessSafe()

bool TLogger::isMultiProcessSafe ( ) const
pure virtual

Returns true if the implementation is guaranteed to be free of race conditions when accessed by multiple processes simultaneously; otherwise returns false.

Implemented in TFileAioLogger.

◆ isOpen()

bool TLogger::isOpen ( ) const
pure virtual

Returns true if the device is open; otherwise returns false. This function should be called from any reimplementations of isOpen().

Implemented in TFileAioLogger.

◆ key()

QString TLogger::key ( ) const
pure virtual

Returns a key that this logger plugin supports.

Implemented in TFileAioLogger.

◆ layout()

const QByteArray & TLogger::layout ( ) const

Returns a reference to the value for the setting layout.

◆ log() [1/2]

virtual void TLogger::log ( const QByteArray &  )
inlinevirtual

Reimplemented in TFileAioLogger.

◆ log() [2/2]

void TLogger::log ( const TLog log)
pure virtual

Writes the log log to the device. This function should be called from any reimplementations of log().

Implemented in TFileAioLogger.

◆ logToByteArray() [1/2]

QByteArray TLogger::logToByteArray ( const TLog log) const
virtual

Converts the log log to its textual representation and returns a QByteArray containing the data.

◆ logToByteArray() [2/2]

QByteArray TLogger::logToByteArray ( const TLog log,
const QByteArray &  layout,
const QByteArray &  dateTimeFormat,
QTextCodec *  codec = 0 
)
static

Converts the log log to its textual representation and returns a QByteArray containing the data.

◆ open()

bool TLogger::open ( )
pure virtual

Opens the device for logging. Returns true if successful; otherwise returns false. This function should be called from any reimplementations of open().

Implemented in TFileAioLogger.

◆ priorityToString()

QByteArray TLogger::priorityToString ( Tf::LogPriority  priority)
static

Returns a QByteArray containing the priority priority.

◆ settingsValue()

QVariant TLogger::settingsValue ( const QString &  k,
const QVariant &  defaultValue = QVariant() 
) const
protected

Returns the value for logger setting key.

If the setting doesn't exist, returns defaultValue.

◆ target()

const QString & TLogger::target ( ) const

Returns a reference to the value for the setting target device.

◆ threshold()

Tf::LogPriority TLogger::threshold ( ) const

Returns the value for the setting priority threshold.


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