6#include <QStringEncoder>
23 virtual QString
key()
const = 0;
28 virtual void log(
const QByteArray &) = 0;
29 virtual void log(
const TLog &tlog) {
log(logToByteArray(tlog)); }
31 virtual QByteArray logToByteArray(
const TLog &log)
const;
33 const QByteArray &layout()
const;
34 const QByteArray &dateTimeFormat()
const;
36 const QString &target()
const;
38 static QByteArray logToByteArray(
const TLog &log,
const QByteArray &layout,
const QByteArray &dateTimeFormat, QStringConverter::Encoding encoding = QStringConverter::Utf8);
42 QStringConverter::Encoding encoding()
const;
43 QVariant settingsValue(
const QString &key,
const QVariant &defaultValue = QVariant())
const;
47 mutable QString _target;
48 mutable std::optional<QStringConverter::Encoding> _encoding;
The TLog class contains log messages for web application.
Definition tlog.h:9
The TLogger class provides an abstract base of logging functionality.
Definition tlogger.h:19
virtual void flush()
Flushes any buffered data to the device.
Definition tlogger.h:30
virtual ~TLogger()
Definition tlogger.h:22
virtual void close()=0
Closes the device.
virtual bool isMultiProcessSafe() const =0
Returns true if the implementation is guaranteed to be free of race conditions when accessed by multi...
virtual bool isOpen() const =0
Returns true if the device is open; otherwise returns false.
virtual void log(const TLog &tlog)
Writes the log log to the device.
Definition tlogger.h:29
virtual QString key() const =0
Returns a key that this logger plugin supports.
virtual bool open()=0
Opens the device for logging.
virtual void log(const QByteArray &)=0
The Tf namespace contains miscellaneous identifiers used throughout the library of TreeFrog Framework...
Definition tdebug.h:10
T_CORE_EXPORT void setAppLogLayout(const QByteArray &layout)
Definition tlogger.cpp:34
T_CORE_EXPORT void setAppLogDateTimeFormat(const QByteArray &format)
Definition tlogger.cpp:40
LogPriority
Definition tfnamespace.h:230
#define T_CORE_EXPORT
Definition tdeclexport.h:28