6 #if QT_VERSION >= 0x060000
7 # include <QStringEncoder>
25 virtual QString
key()
const = 0;
30 virtual void log(
const QByteArray &) = 0;
31 virtual void log(
const TLog &tlog) {
log(logToByteArray(tlog)); }
33 virtual QByteArray logToByteArray(
const TLog &log)
const;
35 const QByteArray &layout()
const;
36 const QByteArray &dateTimeFormat()
const;
38 const QString &target()
const;
40 #if QT_VERSION < 0x060000
41 static QByteArray logToByteArray(
const TLog &log,
const QByteArray &layout,
const QByteArray &dateTimeFormat, QTextCodec *codec =
nullptr);
43 static QByteArray logToByteArray(
const TLog &log,
const QByteArray &layout,
const QByteArray &dateTimeFormat,
QStringConverter::Encoding encoding = QStringConverter::Utf8);
48 #if QT_VERSION < 0x060000
49 QTextCodec *codec()
const;
53 QVariant settingsValue(
const QString &key,
const QVariant &defaultValue = QVariant())
const;
57 mutable QString _target;
58 #if QT_VERSION < 0x060000
59 mutable QTextCodec *_codec {
nullptr};
61 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:21
virtual void flush()
Flushes any buffered data to the device.
Definition: tlogger.h:32
virtual ~TLogger()
Definition: tlogger.h:24
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:31
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:44
@ Encoding
Definition: tfnamespace.h:86
T_CORE_EXPORT void setAppLogDateTimeFormat(const QByteArray &format)
Definition: tlogger.cpp:50
LogPriority
Definition: tfnamespace.h:230
#define T_CORE_EXPORT
Definition: tdeclexport.h:28