Add window support for Windows.
This commit is contained in:
parent
5d32592126
commit
c05b7b6315
27 changed files with 783 additions and 95 deletions
|
@ -1,10 +1,16 @@
|
|||
#pragma once
|
||||
#define MLOG_INFO(msg) FileLogger::GetInstance().LogLine("Info", msg, __FILE__, __FUNCTION__, __LINE__);
|
||||
#define MLOG_ERROR(msg) FileLogger::GetInstance().LogLine("Error", msg, __FILE__, __FUNCTION__, __LINE__);
|
||||
|
||||
#define MLOG_ALL(msg, level) {std::ostringstream mt_logstream;\
|
||||
mt_logstream << msg; \
|
||||
FileLogger::GetInstance().LogLine(level, mt_logstream, __FILE__, __FUNCTION__, __LINE__);};
|
||||
|
||||
#define MLOG_INFO(msg) MLOG_ALL(msg, "Info");
|
||||
#define MLOG_ERROR(msg) MLOG_ALL(msg, "Error");
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
|
||||
class FileLogger
|
||||
{
|
||||
|
@ -41,9 +47,9 @@ public:
|
|||
|
||||
void Close();
|
||||
|
||||
void LogLine(const std::string& line);
|
||||
void LogLine(const std::ostringstream& line);
|
||||
|
||||
void LogLine(const std::string& logType, const std::string& line, const std::string& fileName = "", const std::string& functionName = "", int lineNumber=-1);
|
||||
void LogLine(const std::string& logType, const std::ostringstream& line, const std::string& fileName = "", const std::string& functionName = "", int lineNumber=-1);
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue