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.
31 lines
458 B
C
31 lines
458 B
C
1 month ago
|
#pragma once
|
||
|
|
||
|
#include <fstream>
|
||
|
#include <string>
|
||
|
#include <iostream>
|
||
|
#include <ctime>
|
||
|
#include <sstream>
|
||
|
#include <iomanip>
|
||
|
#include <chrono>
|
||
|
class Logger
|
||
|
{
|
||
|
private:
|
||
|
Logger();
|
||
|
~Logger();
|
||
|
private:
|
||
|
static Logger* m_instance;
|
||
|
private:
|
||
|
static std::ofstream logfile;
|
||
|
public:
|
||
|
void WriteLog(int level , std::string logStr);
|
||
|
public:
|
||
|
static Logger* GetInstance()
|
||
|
{
|
||
|
if (m_instance == nullptr) {
|
||
|
m_instance = new Logger();
|
||
|
}
|
||
|
return m_instance;
|
||
|
}
|
||
|
};
|
||
|
|