feat: Add system log.
This commit is contained in:
28
src/log/SystemOperationLog.h
Normal file
28
src/log/SystemOperationLog.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef SYSTEMOPERATIONLOG_H
|
||||
#define SYSTEMOPERATIONLOG_H
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
|
||||
#define LOG_SYS_OPERATION(...)\
|
||||
SystemOperationLog::getInstance()->log(__VA_ARGS__);
|
||||
|
||||
class SystemOperationLog
|
||||
{
|
||||
public:
|
||||
static SystemOperationLog* getInstance();
|
||||
void log(const QString& aOperationText);
|
||||
void reloadFile();
|
||||
|
||||
private:
|
||||
SystemOperationLog();
|
||||
~SystemOperationLog();
|
||||
|
||||
private:
|
||||
QString mCurrentFileName;
|
||||
QFile mLogFile;
|
||||
QTextStream mStreamOut;
|
||||
};
|
||||
|
||||
#endif // SYSTEMOPERATIONLOG_H
|
||||
Reference in New Issue
Block a user