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