1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 #pragma once19 20 #include "[MathNamespace.h]"21 22 [MATH_BEGIN_NAMESPACE]23 24 25 #ifdef _MSC_VER26 #define MULTI_LINE_MACRO_BEGIN do { \27 __pragma(warning(push)) \28 __pragma(warning(disable:4127))29 30 #define MULTI_LINE_MACRO_END \31 } while(0) \32 __pragma(warning(pop))33 34 #else35 36 #define MULTI_LINE_MACRO_BEGIN do {37 #define MULTI_LINE_MACRO_END } while(0)38 39 #endif40 41 42 typedef unsigned int [MathLogChannel];43 44 namespace45 {46 const [MathLogChannel] MathLogInfo = 1;47 const [MathLogChannel] MathLogError = 2;48 const [MathLogChannel] MathLogWarning = 4;49 const [MathLogChannel] MathLogErrorNoCallstack = MathLogError|65536;50 const [MathLogChannel] MathLogWarningNoCallstack = MathLogWarning|65536;51 }52 53 void [PrintToConsoleVariadic]([MathLogChannel] channel, const char *format, ...);54 void [PrintToConsole]([MathLogChannel] channel, const char *str);55 56 #define STRINGIZE_HELPER(x) #x57 #define STRINGIZE(x) STRINGIZE_HELPER(x)58 #define WARNING(desc) message(__FILE__ "(" STRINGIZE(__LINE__) ") : warning: " #desc)59 60 #ifndef LOGGING_SUPPORT_DISABLED61 62 #define LOGI(...) PrintToConsoleVariadic(MathLogInfo, __VA_ARGS__)63 #define LOGW(...) PrintToConsoleVariadic(MathLogWarning, __VA_ARGS__)64 #define LOGE(...) PrintToConsoleVariadic(MathLogError, __VA_ARGS__)65 #define LOG(channel, ...) PrintToConsoleVariadic(channel, __VA_ARGS__)66 67 #else68 69 #define LOG(...) ((void)0)70 #define LOGE(...) ((void)0)71 #define LOGW(...) ((void)0)72 #define LOGI(...) ((void)0)73 74 #endif75 76 [MATH_END_NAMESPACE] Go back to previous page