2 * @brief Debug APIs for the ircd.
3 * @version $Id: s_debug.h 1231 2004-10-05 04:21:37Z entrope $
5 #ifndef INCLUDED_s_debug_h
6 #define INCLUDED_s_debug_h
7 #ifndef INCLUDED_config_h
8 #include "config.h" /* Needed for DEBUGMODE */
10 #ifndef INCLUDED_ircd_defs_h
11 #include "ircd_defs.h" /* Needed for HOSTLEN */
13 #ifndef INCLUDED_stdarg_h
15 #define INCLUDED_stdarg_h
27 /** If DEBUGMODE is defined, output the debug message.
28 * @param x A two-or-more element list containing level, format and arguments.
30 #define Debug(x) debug x
31 #define LOGFILE LPATH /**< Path to debug log file. */
34 * defined debugging levels
36 #define DEBUG_FATAL 0 /**< fatal error */
37 #define DEBUG_ERROR 1 /**< report_error() and other errors that are found */
38 #define DEBUG_NOTICE 3 /**< somewhat useful, but non-critical, messages */
39 #define DEBUG_DNS 4 /**< used by all DNS related routines - a *lot* */
40 #define DEBUG_INFO 5 /**< general useful info */
41 #define DEBUG_SEND 7 /**< everything that is sent out */
42 #define DEBUG_DEBUG 8 /**< everything that is received */
43 #define DEBUG_MALLOC 9 /**< malloc/free calls */
44 #define DEBUG_LIST 10 /**< debug list use */
45 #define DEBUG_ENGINE 11 /**< debug event engine; can dump gigabyte logs */
51 extern void vdebug(int level, const char *form, va_list vl);
52 extern void debug(int level, const char *form, ...);
53 extern void send_usage(struct Client *cptr, const struct StatDesc *sd,
56 #else /* !DEBUGMODE */
59 #define LOGFILE "/dev/null"
61 #endif /* !DEBUGMODE */
63 extern const char* debug_serveropts(void);
64 extern void debug_init(int use_tty);
65 extern void count_memory(struct Client *cptr, const struct StatDesc *sd,
68 #endif /* INCLUDED_s_debug_h */