feat: merge the UserOperationLog and SystemOperationLog in LogManager.
This commit is contained in:
41
src/log/LogManager.h
Normal file
41
src/log/LogManager.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#ifndef LOGMANAGER_H
|
||||
#define LOGMANAGER_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include "SystemOperationLog.h"
|
||||
#include "UserOperationLog.h"
|
||||
|
||||
class QThread;
|
||||
|
||||
#define LOG_SYS_OPERATION(...)\
|
||||
LogManager::getInstance()->writeSystemOperationLog(__VA_ARGS__);
|
||||
|
||||
|
||||
#define LOG_USER_OPERATION(...)\
|
||||
LogManager::getInstance()->writeUserOperationLog(__VA_ARGS__);
|
||||
|
||||
class LogManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static LogManager* getInstance();
|
||||
void writeSystemOperationLog(const QString& aMessage);
|
||||
void writeUserOperationLog(const QString& aMessage);
|
||||
QString getCurrentUserOperationLogFile();
|
||||
|
||||
signals:
|
||||
void doWriteSystemOperationLog(const QString& aMessage);
|
||||
void doWriteUserOperationLog(const QString& aMessage);
|
||||
|
||||
private:
|
||||
LogManager();
|
||||
~LogManager();
|
||||
|
||||
private:
|
||||
QThread* mThread;
|
||||
SystemOperationLog* mSysLog;
|
||||
UserOperationLog* mUserLog;
|
||||
};
|
||||
|
||||
#endif // LOGMANAGER_H
|
||||
Reference in New Issue
Block a user