C SIGFOX CALLBACK  0.0.1
A Sigfox Callback program writtent in C
logging.h
Go to the documentation of this file.
1 
10 #ifndef __LOGGING_H__
11 #define __LOGGING_H__
12 
13 #include <stdio.h> // fprintf, stderr, stdout
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 
26 #ifdef __DEBUG__
27  #define iprintf(format, ...) fprintf(stdout, "\e[1m[%s]\e[0m " format, __func__, ## __VA_ARGS__)
28 #else
29  #define iprintf(format, ...) fprintf(stdout, "INFO: " format, ## __VA_ARGS__)
30 #endif
31 
32 
39 #ifdef __DEBUG__
40  #define eprintf(format, ...) fprintf(stderr, "\e[1;31m[%s]\e[0m " format, __func__, ## __VA_ARGS__)
41 #else
42  #define eprintf(format, ...) fprintf(stdout, "\e[1;31mERROR:\e[0m " format, ## __VA_ARGS__)
43 #endif
44 
45 
52 #ifdef __DEBUG__
53  #define cprintf(format, ...) fprintf(stdout, "\e[1;33m[%s]\e[0m " format, __func__, ## __VA_ARGS__)
54 #else
55  #define cprintf(format, ...) fprintf(stdout, "\e[1;33mCAUTION:\e[0m " format, ## __VA_ARGS__)
56 #endif
57 
58 
65 #ifdef __DEBUG__
66  #define gprintf(format, ...) fprintf(stdout, "\e[1;32m[%s]\e[0m " format, __func__, ## __VA_ARGS__)
67 #else
68  #define gprintf(format, ...) fprintf(stdout, format, ## __VA_ARGS__)
69 #endif
70 
71 #ifdef __cplusplus
72 }
73 #endif
74 
75 #endif // __LOGGING_H__