3 #include "vg_platform.h"
6 #define VG_LOG_MCSTR(S) VG_LOG_MCSTR2(S)
7 #define VG_LOG_MCSTR2(S) #S
8 #define VG_LOG_WHERE "@" __FILE__ ":" VG_LOG_MCSTR(__LINE__)\
11 #define vg_success( ... ) \
12 vg_logx(stdout,VG_LOG_WHERE,"success",KGRN,__VA_ARGS__)
13 #define vg_info( ... ) \
14 vg_logx(stdout,VG_LOG_WHERE,"info",KNRM,__VA_ARGS__)
15 #define vg_warn( ... ) \
16 vg_logx(stdout,VG_LOG_WHERE,"warn",KYEL,__VA_ARGS__ )
17 #define vg_error( ... ) \
18 vg_logx(stdout,VG_LOG_WHERE,"error",KRED,__VA_ARGS__)
19 #define vg_low( ... ) \
20 vg_logx(stdout,VG_LOG_WHERE,"log",KWHT,__VA_ARGS__)
22 #define KNRM "\x1B[0m"
23 #define KBLK "\x1B[30m"
24 #define KRED "\x1B[31m"
25 #define KGRN "\x1B[32m"
26 #define KYEL "\x1B[33m"
27 #define KBLU "\x1B[34m"
28 #define KMAG "\x1B[35m"
29 #define KCYN "\x1B[36m"
30 #define KWHT "\x1B[37m"
32 #define PRINTF_v2f( V2 ) "%.4f %.4f\n", V2[0], V2[1]
33 #define PRINTF_v3f( V3 ) "%.4f %.4f %.4f\n", V3[0], V3[1], V3[2]
34 #define PRINTF_v4f( V4 ) "%.4f %.4f %.4f %.4f\n", V4[0], V4[1], V4[2], V4[3]
37 #define PRINTF_U64 "%llu"
39 #define PRINTF_U64 "%lu"
43 #include "dep/sdl/include/SDL.h"
49 u32 log_line_count
, log_line_current
;
52 SDL_SpinLock print_sl
;
57 void vg_logx( FILE *file
,
58 const char *location
, const char *prefix
,
60 const char *fmt
, ... );
62 void _vg_logx_va( FILE *file
,
63 const char *location
, const char *prefix
,
65 const char *fmt
, va_list args
);
67 void vg_print_backtrace(void);