forked from yaosj2k/dnsforwarder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
debug.h
executable file
·31 lines (19 loc) · 878 Bytes
/
debug.h
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
#ifndef DEBUG_H_INCLUDED
#define DEBUG_H_INCLUDED
#include "readconfig.h"
#include "common.h"
#define PRINT(...) if(ShowMassages == TRUE){ printf(__VA_ARGS__); } DEBUG_FILE(__VA_ARGS__);
#define INFO(...) if(ShowMassages == TRUE){ printf("[INFO] "__VA_ARGS__); } DEBUG_FILE("[INFO] " __VA_ARGS__);
#define ERRORMSG(...) if(ErrorMessages == TRUE){ fprintf(stderr, "[ERROR] "__VA_ARGS__); } DEBUG_FILE("[ERROR] " __VA_ARGS__);
/* Global Varibles */
extern BOOL ShowMassages;
extern BOOL ErrorMessages;
#define DEBUG_FILE(...) Debug_PrintFile(__VA_ARGS__)
#define DEBUGP(...) fprintf(stderr, "[DEBUG] "__VA_ARGS__); \
DEBUG_FILE(__VA_ARGS__);
#define DEBUGMODE Debug_Inited()
#define DEBUG if( DEBUGMODE )
int Debug_Init(ConfigFileInfo *ConfigInfo);
BOOL Debug_Inited(void);
void Debug_PrintFile(const char *format, ...);
#endif // DEBUG_H_INCLUDED