40 lines
578 B
C++
40 lines
578 B
C++
#include "Log.hpp"
|
|
|
|
#include <iostream>
|
|
#include <mutex>
|
|
|
|
std::mutex mOutput;
|
|
|
|
#ifdef _DEBUG
|
|
void Log(const char* msg)
|
|
{
|
|
std::lock_guard lock(mOutput);
|
|
std::cout << msg << '\n';
|
|
}
|
|
|
|
void Log(const std::string& msg)
|
|
{
|
|
std::lock_guard lock(mOutput);
|
|
std::cout << msg << '\n';
|
|
}
|
|
#else
|
|
void Log(const char* msg)
|
|
{
|
|
}
|
|
|
|
void Log(const std::string& msg)
|
|
{
|
|
}
|
|
#endif
|
|
|
|
void Message(const char* msg)
|
|
{
|
|
std::lock_guard lock(mOutput);
|
|
std::cout << msg << '\n';
|
|
}
|
|
|
|
void Message(const std::string& msg)
|
|
{
|
|
std::lock_guard lock(mOutput);
|
|
std::cout << msg << '\n';
|
|
} |