mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Renamed src to backend
This commit is contained in:
7
backend/logger/include/interface.h
Normal file
7
backend/logger/include/interface.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
#include "framework.h"
|
||||
|
||||
void DllExport setLogDirectory(std::string m_dirPath);
|
||||
void DllExport log(const std::string& sMessage, bool addToJSON = false);
|
||||
void DllExport log(const std::wstring& sMessage, bool addToJSON = false);
|
||||
void DllExport getLogsJSON(json::value& json, unsigned long long time);
|
||||
32
backend/logger/include/logger.h
Normal file
32
backend/logger/include/logger.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
#include "framework.h"
|
||||
#include "interface.h"
|
||||
|
||||
class Logger
|
||||
{
|
||||
public:
|
||||
void log(const string& sMessage, bool addToJSON);
|
||||
void log(const wstring& sMessage, bool addToJSON);
|
||||
void toJSON(json::value& json, unsigned long long time);
|
||||
void setDirectory(string newDirPath);
|
||||
|
||||
static Logger* GetLogger();
|
||||
|
||||
private:
|
||||
Logger();
|
||||
Logger(const Logger&) {}; // copy constructor is private
|
||||
Logger& operator=(const Logger&) { return *this; }; // assignment operator is private
|
||||
|
||||
static const string m_sFileName;
|
||||
static Logger* m_pThis;
|
||||
static ofstream m_Logfile;
|
||||
static std::map<unsigned long long, std::string> m_logs;
|
||||
static string m_dirPath;
|
||||
|
||||
mutex mutexLock;
|
||||
|
||||
void Open();
|
||||
void Close();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user