base: implement LOG macro which only prints if VERBOSE_LOGS = 1
This allows us to make builds that don't have verbose logging, whether they're debug or not. We could have release builds that have verbose logging.
This commit is contained in:
@@ -19,6 +19,20 @@
|
||||
#define FAIL(MSG) assert(false && "FAIL: " #MSG)
|
||||
#define TODO(MSG) assert(false && "TODO: " #MSG)
|
||||
|
||||
#ifndef VERBOSE_LOGS
|
||||
#define VERBOSE_LOGS 0
|
||||
#endif
|
||||
|
||||
#if VERBOSE_LOGS
|
||||
#define LOG(...) \
|
||||
do \
|
||||
{ \
|
||||
printf(__VA_ARGS__); \
|
||||
} while (0)
|
||||
#else
|
||||
#define LOG(...)
|
||||
#endif
|
||||
|
||||
/// Numeric aliases
|
||||
typedef uint8_t u8;
|
||||
typedef uint16_t u16;
|
||||
|
||||
Reference in New Issue
Block a user