Rev 18 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 18 | Rev 20 | ||
---|---|---|---|
Line 2... | Line 2... | ||
2 | #define HARNESS_TRACE_H |
2 | #define HARNESS_TRACE_H |
3 | 3 | ||
4 | #include "brender.h" |
4 | #include "brender/br_types.h" |
5 | #include <stdlib.h> |
5 | #include <stdlib.h> |
6 | 6 | ||
7 | extern int harness_debug_level; |
7 | extern int harness_debug_level; |
8 | 8 | ||
9 | void debug_printf(const char* fmt, const char* fn, const char* fmt2, ...); |
9 | void debug_printf(const char* fmt, const char* fn, const char* fmt2, ...); |
10 | void panic_printf(const char* fmt, const char* fn, const char* fmt2, ...); |
- | |
11 | void debug_print_vector3(const char* fmt, const char* fn, char* msg, br_vector3* v); |
10 | void debug_print_vector3(const char* fmt, const char* fn, char* msg, br_vector3* v); |
12 | void debug_print_matrix34(const char* fmt, const char* fn, char* name, br_matrix34* m); |
11 | void debug_print_matrix34(const char* fmt, const char* fn, char* name, br_matrix34* m); |
13 | void debug_print_matrix4(const char* fmt, const char* fn, char* name, br_matrix4* m); |
12 | void debug_print_matrix4(const char* fmt, const char* fn, char* name, br_matrix4* m); |
14 | 13 | ||
15 | #define BLUE |
14 | #define BLUE |
Line 39... | Line 38... | ||
39 | #define LOG_MATRIX4(msg, m) debug_print_matrix4("\033[0;34m[DEBUG] %s ", __FUNCTION__, msg, m) |
38 | #define LOG_MATRIX4(msg, m) debug_print_matrix4("\033[0;34m[DEBUG] %s ", __FUNCTION__, msg, m) |
40 | #define LOG_INFO(...) debug_printf("[INFO] %s ", __FUNCTION__, __VA_ARGS__) |
39 | #define LOG_INFO(...) debug_printf("[INFO] %s ", __FUNCTION__, __VA_ARGS__) |
41 | #define LOG_WARN(...) debug_printf("\033[0;33m[WARN] %s ", __FUNCTION__, __VA_ARGS__) |
40 | #define LOG_WARN(...) debug_printf("\033[0;33m[WARN] %s ", __FUNCTION__, __VA_ARGS__) |
42 | #define LOG_PANIC(...) \ |
41 | #define LOG_PANIC(...) \ |
43 | do { \ |
42 | do { \ |
44 | |
43 | debug_printf("\033[0;31m[PANIC] %s ", __FUNCTION__, __VA_ARGS__); \ |
45 | abort(); \ |
44 | abort(); \ |
46 | } while (0) |
45 | } while (0) |
47 | 46 | ||
48 | #define LOG_WARN_ONCE(...) \ |
47 | #define LOG_WARN_ONCE(...) \ |
49 | static int warn_printed = 0; \ |
48 | static int warn_printed = 0; \ |