35e84d0053c97e70a50cebab2e67f125106f5cd3
[ircu2.10.12-pk.git] / include / s_debug.h
1 /*
2  * s_debug.h
3  *
4  * $Id$
5  */
6 #ifndef INCLUDED_s_debug_h
7 #define INCLUDED_s_debug_h
8 #ifndef INCLUDED_config_h
9 #include "config.h"          /* Needed for DEBUGMODE */
10 #endif
11 #ifndef INCLUDED_ircd_defs_h
12 #include "ircd_defs.h"       /* Needed for HOSTLEN */
13 #endif
14 #ifndef INCLUDED_stdarg_h
15 #include <stdarg.h>
16 #define INCLUDED_stdarg_h
17 #endif
18
19 struct Client;
20 struct StatDesc;
21
22 #ifdef DEBUGMODE
23
24 /*
25  * Macro's
26  */
27
28 #define Debug(x) debug x
29 #define LOGFILE LPATH
30
31 /*
32  * defined debugging levels
33  */
34 #define DEBUG_FATAL   0
35 #define DEBUG_ERROR   1  /* report_error() and other errors that are found */
36 #define DEBUG_NOTICE  3
37 #define DEBUG_DNS     4  /* used by all DNS related routines - a *lot* */
38 #define DEBUG_INFO    5  /* general useful info */
39 #define DEBUG_NUM     6  /* numerics */
40 #define DEBUG_SEND    7  /* everything that is sent out */
41 #define DEBUG_DEBUG   8  /* everything that is received */ 
42 #define DEBUG_MALLOC  9  /* malloc/free calls */
43 #define DEBUG_LIST   10  /* debug list use */
44 #define DEBUG_ENGINE 11  /* debug event engine; can dump gigabyte logs */
45
46 /*
47  * proto types
48  */
49
50 extern void vdebug(int level, const char *form, va_list vl);
51 extern void debug(int level, const char *form, ...);
52 extern void send_usage(struct Client *cptr, const struct StatDesc *sd,
53                        char *param);
54
55 #else /* !DEBUGMODE */
56
57 #define Debug(x)
58 #define LOGFILE "/dev/null"
59
60 #endif /* !DEBUGMODE */
61
62 extern const char* debug_serveropts(void);
63 extern void debug_init(int use_tty);
64 extern void count_memory(struct Client *cptr, const struct StatDesc *sd,
65                          char *param);
66
67 #endif /* INCLUDED_s_debug_h */