-
Notifications
You must be signed in to change notification settings - Fork 0
/
debug_logging.c
32 lines (25 loc) · 1023 Bytes
/
debug_logging.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <stdio.h>
#include "../src/debug.h"
// -----------------------------------------------------------------------------
// The debug logging macros are automatically enabled if you compile this
// example with a "Debug" build type if the library isn't included in
// another CMake project !
// -----------------------------------------------------------------------------
int main() {
#if defined(NP_DEBUG_LOGGING)
printf("Debug logging is enabled !\n");
#else
printf("Debug logging is disabled !\n");
printf("Define `NP_DEBUG_LOGGING` in order to enable it.\n");
#endif
printf("> Trace prints:\n");
trace_printA("Trace message\n");
trace_printlnA("Now with parameters => '%d'+'%d'='%d'", 42, 5, 42 + 5);
printf("> Debug prints:\n");
debug_printA("Debug message\n");
debug_printlnA("Now with a parameter => '%s'", "Howdy :)");
printf("> Error prints:\n");
error_printA("Error message\n");
error_printlnA("Now with a parameter => '0x%08lx'", (unsigned long) 3735928559);
return 0;
}