init
This commit is contained in:
64
debug.h
Normal file
64
debug.h
Normal file
@@ -0,0 +1,64 @@
|
||||
|
||||
/***********************************************************/
|
||||
/* Telnet3d (the single process telnet service) written by
|
||||
/* <WildThang> (dvmitche@nssl.uoknor.edu) ALL RIGHTS RESERVED.
|
||||
/*
|
||||
/* Duplication of this code is not permitted without explicit
|
||||
/* aproval from the authors (dvmitche@nssl.uoknor.edu) in whole
|
||||
/* or in parts.
|
||||
/*
|
||||
/* This project was designed to be used on UNDERNET IRC ONLY.
|
||||
/* No exceptions to this without explicit permission from the
|
||||
/* authors (dvmitche@nssl.uoknor.edu)
|
||||
/*
|
||||
/* Special Thanks for your ideas and support with this project.
|
||||
/* go out to:
|
||||
/* mandar@vinson.ecn.uoknor.edu
|
||||
/*
|
||||
/* NOTE: dvmitche@nssl.uoknor.edu is now danny@chatsystems.com
|
||||
/*************************************************************/
|
||||
|
||||
/*#define DEBUG D_ALL /* */
|
||||
|
||||
FILE *debug_log;
|
||||
#define DEBUG_LOGFILE "/tmp/debug.log"
|
||||
#ifdef DEBUG
|
||||
#define D_ALL (1 << 0)
|
||||
#define D_WARNING (1 << 1)
|
||||
#define D_ERROR (1 << 2)
|
||||
#define D_FILE (1 << 3)
|
||||
#define D_ERRNO (1 << 4)
|
||||
#define D_MEMORY (1 << 5)
|
||||
#define D_TRACE (1 << 6)
|
||||
#define D_SOCKET (1 << 7)
|
||||
#define D_INPUT (1 << 8)
|
||||
#define D_KLINE (1 << 9)
|
||||
#define D_NICKLIST (1 << 10)
|
||||
#define D_BUFFER (1 << 11)
|
||||
#define D_CHANLIST (1 << 12)
|
||||
#endif
|
||||
|
||||
|
||||
/******************************************************************/
|
||||
/* SPECIAL THANKS to Robin Thelland (intru@hamming.info.polymtl.ca)
|
||||
/* for his input and ideas in improving the debug functions
|
||||
/******************************************************************/
|
||||
#ifdef DEBUG
|
||||
#define my_debug(X,Y) if((DEBUG == D_ALL) || (DEBUG & X)) \
|
||||
{ if(debug_log != NULL) { \
|
||||
fprintf(debug_log,"[%s:%d] ",__FILE__,__LINE__); \
|
||||
fprintf Y; fprintf(debug_log,"\n"); fflush(debug_log); \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
# define my_debug(X,Y)
|
||||
#endif
|
||||
#ifdef DEBUG
|
||||
#define my_dump(X,Y) if(DUMPLOG == D_ALL) \
|
||||
{ if(dump_log != NULL) { \
|
||||
fprintf Y; fprintf(dump_log,"\n"); fflush(dump_log); \
|
||||
} \
|
||||
}
|
||||
#else
|
||||
# define my_debug(X,Y)
|
||||
#endif
|
||||
Reference in New Issue
Block a user