TreeFrogFramework  2.6
tfileaiologger.h
Go to the documentation of this file.
1 #pragma once
2 #include <QString>
3 #include <TLogger>
4 
5 class TFileAioWriter;
6 
7 
9 public:
11  ~TFileAioLogger();
12 
13  QString key() const override { return "FileAioLogger"; }
14  bool isMultiProcessSafe() const override { return true; }
15  bool open() override;
16  void close() override;
17  bool isOpen() const override;
18  void log(const QByteArray &msg) override;
19  void log(const TLog &tlog) override { TLogger::log(tlog); }
20  void flush() override;
21  void setFileName(const QString &name);
22 
23 private:
24  TFileAioWriter *writer {nullptr};
25 
28 };
29 
The TFileAioLogger class provides asynchronous logging functionality to a log file.
Definition: tfileaiologger.h:8
void log(const TLog &tlog) override
Writes the log log to the device.
Definition: tfileaiologger.h:19
QString key() const override
Returns a key that this logger plugin supports.
Definition: tfileaiologger.h:13
bool isMultiProcessSafe() const override
Returns true if the implementation is guaranteed to be free of race conditions when accessed by multi...
Definition: tfileaiologger.h:14
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 void close()=0
Closes the device.
virtual bool isOpen() const =0
Returns true if the device is open; otherwise returns false.
virtual bool open()=0
Opens the device for logging.
virtual void log(const QByteArray &)=0
#define T_CORE_EXPORT
Definition: tdeclexport.h:28
#define T_DISABLE_COPY(Class)
Definition: tdeclexport.h:37
#define T_DISABLE_MOVE(Class)
Definition: tdeclexport.h:41