TreeFrogFramework  1.18
Public Member Functions | Static Public Member Functions | Protected Attributes | 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
 
void readSettings ()
 
const QByteArray & layout () const
 
const QByteArray & dateTimeFormat () const
 
Tf::LogPriority threshold () const
 
const QString & target () const
 
QVariant settingsValue (const QString &key, const QVariant &defaultValue=QVariant()) 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 Attributes

QByteArray layout_
 
QByteArray dateTimeFormat_
 
Tf::LogPriority threshold_
 
QString target_
 
QTextCodec * codec_
 

Detailed Description

The TLogger class provides an abstract base of logging functionality.

Constructor & Destructor Documentation

TLogger::TLogger ( )

Constructor.

virtual TLogger::~TLogger ( )
inlinevirtual

Member Function Documentation

void TLogger::close ( )
pure virtual

Closes the device.

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

Implemented in TFileAioLogger.

const QByteArray & TLogger::dateTimeFormat ( ) const
inline

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

void TLogger::flush ( )
inlinevirtual

Flushes any buffered data to the device.

This function should be called from any reimplementations of flush().

Reimplemented in TFileAioLogger.

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.

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.

QString TLogger::key ( ) const
pure virtual

Returns a key that this logger plugin supports.

Implemented in TFileAioLogger.

const QByteArray & TLogger::layout ( ) const
inline

Returns a reference to the value for the setting layout.

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.

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

Reimplemented in TFileAioLogger.

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

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

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.

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.

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

Returns a QByteArray containing the priority priority.

void TLogger::readSettings ( )

Reads the settings stored in the file logger.ini.

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

Returns the value for logger setting key.

If the setting doesn't exist, returns defaultValue.

const QString & TLogger::target ( ) const
inline

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

Priority TLogger::threshold ( ) const
inline

Returns the value for the setting priority threshold.

Member Data Documentation

QTextCodec* TLogger::codec_
protected
QByteArray TLogger::dateTimeFormat_
protected
QByteArray TLogger::layout_
protected
QString TLogger::target_
protected
Tf::LogPriority TLogger::threshold_
protected

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