Change log levels names to avoid collisions

This commit is contained in:
2022-08-07 16:44:14 +02:00
parent 3c73b8ccb3
commit 33bb983283
4 changed files with 26 additions and 26 deletions

View File

@@ -140,7 +140,7 @@ namespace gourou
std::stringstream msg;
msg << "Exception code : 0x" << std::setbase(16) << code << std::endl;
msg << "Message : " << message << std::endl;
if (logLevel >= DEBUG)
if (logLevel >= LG_LOG_DEBUG)
msg << "File : " << file << ":" << std::setbase(10) << line << std::endl;
fullmessage = strdup(msg.str().c_str());
}

View File

@@ -24,16 +24,16 @@
namespace gourou {
enum GOUROU_LOG_LEVEL {
ERROR,
WARN,
INFO,
DEBUG,
TRACE
LG_LOG_ERROR,
LG_LOG_WARN,
LG_LOG_INFO,
LG_LOG_DEBUG,
LG_LOG_TRACE
};
extern GOUROU_LOG_LEVEL logLevel;
#define GOUROU_LOG(__lvl, __msg) if (__lvl <= gourou::logLevel) {std::cout << __msg << std::endl << std::flush;}
#define GOUROU_LOG(__lvl, __msg) if (gourou::LG_LOG_##__lvl <= gourou::logLevel) {std::cout << __msg << std::endl << std::flush;}
#define GOUROU_LOG_FUNC() GOUROU_LOG(TRACE, __FUNCTION__ << "() @ " << __FILE__ << ":" << __LINE__)
/**