mirror of
https://github.com/scorpion-26/gBar.git
synced 2024-11-25 04:32:10 +00:00
29 lines
715 B
C
29 lines
715 B
C
|
#pragma once
|
||
|
#include <sstream>
|
||
|
|
||
|
#ifdef USE_LOGFILE
|
||
|
#define LOG(x) \
|
||
|
std::cout << x << '\n'; \
|
||
|
{ \
|
||
|
std::stringstream str; \
|
||
|
str << x; \
|
||
|
Logging::Log(str.str()); \
|
||
|
}
|
||
|
#else
|
||
|
#define LOG(x) std::cout << x << '\n'
|
||
|
#endif
|
||
|
#define ASSERT(x, log) \
|
||
|
if (!(x)) \
|
||
|
{ \
|
||
|
LOG(log << "\n[Exiting due to assert failed]"); \
|
||
|
exit(-1); \
|
||
|
}
|
||
|
namespace Logging
|
||
|
{
|
||
|
void Init();
|
||
|
|
||
|
void Log(const std::string& str);
|
||
|
|
||
|
void Shutdown();
|
||
|
}
|