42 lines
896 B
C
42 lines
896 B
C
|
|
#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
|