TreeFrogFramework: TLogger Class Reference
#include <tlogger.h>
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 QByteArray &)=0 |
| virtual void | log (const TLog &tlog) |
| 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 |
Protected Member Functions | |
| QStringConverter::Encoding | encoding () const |
| QVariant | settingsValue (const QString &key, const QVariant &defaultValue=QVariant()) const |
The TLogger class provides an abstract base of logging functionality.
◆ ~TLogger()
|
inlinevirtual |
◆ close()
|
pure virtual |
Closes the device.
This function should be called from any reimplementations of close().
Implemented in TStdOutLogger.
◆ dateTimeFormat()
| const QByteArray & TLogger::dateTimeFormat | ( | ) | const |
Returns a reference to the value for the setting datetime format.
◆ encoding()
|
protected |
Returns the default text encoding.
◆ flush()
|
inlinevirtual |
Flushes any buffered data to the device.
This function should be called from any reimplementations of flush().
Reimplemented in TStdOutLogger.
◆ isMultiProcessSafe()
|
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 TStdOutLogger.
◆ isOpen()
|
pure virtual |
Returns true if the device is open; otherwise returns false.
This function should be called from any reimplementations of isOpen().
Implemented in TStdOutLogger.
◆ key()
|
pure virtual |
Returns a key that this logger plugin supports.
Implemented in TStdOutLogger.
◆ layout()
| const QByteArray & TLogger::layout | ( | ) | const |
Returns a reference to the value for the setting layout.
◆ log() [1/2]
|
pure virtual |
◆ log() [2/2]
|
inlinevirtual |
Writes the log log to the device.
This function should be called from any reimplementations of log().
◆ logToByteArray() [1/2]
|
virtual |
Converts the log log to its textual representation and returns a QByteArray containing the data.
◆ logToByteArray() [2/2]
|
static |
Converts the log log to its textual representation and returns a QByteArray containing the data.
◆ 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 TStdOutLogger.
◆ priorityToString()
Returns a QByteArray containing the priority priority.
◆ settingsValue()
|
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()
Returns the value for the setting priority threshold.
The documentation for this class was generated from the following files:
- src/tlogger.h
- src/tlogger.cpp