You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
674 B
C
46 lines
674 B
C
|
6 hours ago
|
#pragma once
|
||
|
|
|
||
|
|
#include <fstream>
|
||
|
|
#include <string>
|
||
|
|
#include <iostream>
|
||
|
|
#include <ctime>
|
||
|
|
#include <sstream>
|
||
|
|
#include <iomanip>
|
||
|
|
#include <chrono>
|
||
|
|
#include <vector>
|
||
|
|
|
||
|
|
class LogManager
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
enum LogType
|
||
|
|
{
|
||
|
|
RunLog = 0,
|
||
|
|
ExceptionLog,
|
||
|
|
DataLog,
|
||
|
|
PELog
|
||
|
|
};
|
||
|
|
|
||
|
|
public:
|
||
|
|
LogManager();
|
||
|
|
~LogManager();
|
||
|
|
|
||
|
|
|
||
|
|
private:
|
||
|
|
static std::ofstream logfile;
|
||
|
|
public:
|
||
|
|
void WriteLog(LogType logType, std::string logStr);
|
||
|
|
void WriteLog(LogType logType, std::string DataName, std::vector<char>& dataContent);
|
||
|
|
|
||
|
|
private:
|
||
|
|
static LogManager* m_instance;
|
||
|
|
public:
|
||
|
|
static LogManager* GetInstance()
|
||
|
|
{
|
||
|
|
if (m_instance == nullptr) {
|
||
|
|
m_instance = new LogManager();
|
||
|
|
}
|
||
|
|
return m_instance;
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|