54 lines
736 B
C
54 lines
736 B
C
|
|
#ifndef QLOG_H
|
|||
|
|
#define QLOG_H
|
|||
|
|
|
|||
|
|
#include "thread.h"
|
|||
|
|
#include <queue>
|
|||
|
|
#include <Windows.h>
|
|||
|
|
#include <QString>
|
|||
|
|
using namespace std;
|
|||
|
|
class QLog
|
|||
|
|
{
|
|||
|
|
public:
|
|||
|
|
QLog(QString strDirName);
|
|||
|
|
|
|||
|
|
void setLogOpen(bool bl);
|
|||
|
|
|
|||
|
|
void start();
|
|||
|
|
|
|||
|
|
void addLog(const char* format, ...);
|
|||
|
|
|
|||
|
|
|
|||
|
|
void stop();
|
|||
|
|
|
|||
|
|
bool isStart();
|
|||
|
|
|
|||
|
|
protected:
|
|||
|
|
void run();
|
|||
|
|
|
|||
|
|
private:
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
static void fun(void* pthis);
|
|||
|
|
|
|||
|
|
// static QLog* m_log;
|
|||
|
|
Thread* m_thread;
|
|||
|
|
|
|||
|
|
queue<string> m_logList;
|
|||
|
|
|
|||
|
|
bool m_isOpen;
|
|||
|
|
|
|||
|
|
bool m_isExit;
|
|||
|
|
|
|||
|
|
char m_fileName[256];
|
|||
|
|
int m_currentIndex;
|
|||
|
|
|
|||
|
|
HANDLE m_hUDPMutex;
|
|||
|
|
int createDirectory(std::string path);
|
|||
|
|
QString m_strDirName;
|
|||
|
|
FILE* fp ;
|
|||
|
|
QString m_strDir;
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
#endif // QLOG_H
|