Console: Add log macros

This commit is contained in:
Stenzek 2024-04-23 22:14:11 +10:00 committed by Connor McLaughlin
parent 8bfcbdebf3
commit 964dcfcb0a
1 changed files with 9 additions and 0 deletions

View File

@ -181,10 +181,19 @@ struct NullLogWriter
extern ConsoleLogWriter<LOGLEVEL_INFO> Console;
extern ConsoleLogWriter<LOGLEVEL_DEV> DevCon;
#define ERROR_LOG(...) Log::Write(LOGLEVEL_ERROR, Color_StrongRed, __VA_ARGS__)
#define WARNING_LOG(...) Log::Write(LOGLEVEL_WARNING, Color_StrongOrange, __VA_ARGS__)
#define INFO_LOG(...) Log::Write(LOGLEVEL_INFO, Color_White, __VA_ARGS__)
#define DEV_LOG(...) Log::Write(LOGLEVEL_DEV, Color_StrongGray, __VA_ARGS__)
#ifdef _DEBUG
extern ConsoleLogWriter<LOGLEVEL_DEBUG> DbgConWriter;
#define DbgCon DbgConWriter
#define DEBUG_LOG(...) Log::Write(LOGLEVEL_TRACE, Color_Gray, __VA_ARGS__)
#define TRACE_LOG(...) Log::Write(LOGLEVEL_TRACE, Color_Blue, __VA_ARGS__)
#else
extern NullLogWriter DbgConWriter;
#define DbgCon 0 && DbgConWriter
#define DEBUG_LOG(...) (void)0
#define TRACE_LOG(...) (void)0
#endif