debug.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef DEBUG_H
00009 #define DEBUG_H
00010
00035 #include "int_sizes.h"
00036
00037 #include <unistd.h>
00038
00039 #include <sys/types.h>
00040
00041 #include <stdarg.h>
00042 #include <stdio.h>
00043
00044
00045 #define D_INFO (0LL)
00046 #define D_FATAL (1LL<<0)
00047 #define D_ERROR (1LL<<1)
00048 #define D_NOTICE (1LL<<2)
00049 #define D_DEBUG (1LL<<3)
00051
00052 #define D_SYSCALL (1LL<<4)
00053 #define D_CHANNEL (1LL<<5)
00054 #define D_PROCESS (1LL<<6)
00055 #define D_RESOLVE (1LL<<7)
00056 #define D_LIBCALL (1LL<<8)
00057 #define D_LOCAL (1LL<<9)
00058 #define D_DNS (1LL<<10)
00059 #define D_TCP (1LL<<11)
00060 #define D_AUTH (1LL<<12)
00061 #define D_IRODS (1LL<<13)
00062 #define D_CVMFS (1LL<<14)
00063 #define D_HTTP (1LL<<15)
00064 #define D_FTP (1LL<<16)
00065 #define D_NEST (1LL<<17)
00066 #define D_GROW (1LL<<18)
00067 #define D_CHIRP (1LL<<19)
00068 #define D_DCAP (1LL<<20)
00069 #define D_RFIO (1LL<<21)
00070 #define D_GLITE (1LL<<22)
00071 #define D_MULTI (1LL<<23)
00072 #define D_PSTREE (1LL<<24)
00073 #define D_ALLOC (1LL<<25)
00074 #define D_LFC (1LL<<26)
00075 #define D_GFAL (1LL<<27)
00076 #define D_SUMMARY (1LL<<28)
00077 #define D_LOGIN (1LL<<29)
00078 #define D_CACHE (1LL<<30)
00079 #define D_POLL (1LL<<31)
00080 #define D_HDFS (1LL<<32)
00081 #define D_WQ (1LL<<33)
00082 #define D_BXGRID (1LL<<34)
00083 #define D_USER (1LL<<35)
00084 #define D_XROOTD (1LL<<36)
00085 #define D_MPI (1LL<<37)
00086 #define D_BATCH (1LL<<38)
00087 #define D_RMON (1LL<<39)
00090 #define D_REMOTE (D_HTTP|D_FTP|D_NEST|D_CHIRP|D_DCAP|D_RFIO|D_LFC|D_GFAL|D_MULTI|D_GROW|D_IRODS|D_HDFS|D_BXGRID|D_XROOTD|D_CVMFS)
00091
00093 #define D_ALL (~(0LL))
00094
00095
00096
00097
00098
00099
00100
00101
00102 #define debug cctools_debug
00103 #define fatal cctools_fatal
00104 #define warn cctools_warn
00105 #define debug_config cctools_debug_config
00106 #define debug_config_file cctools_debug_config_file
00107 #define debug_config_file_size cctools_debug_config_file_size
00108 #define debug_config_fatal cctools_debug_config_fatal
00109 #define debug_config_getpid cctools_debug_config_getpid
00110 #define debug_flags_set cctools_debug_flags_set
00111 #define debug_flags_print cctools_debug_flags_print
00112 #define debug_flags_clear cctools_debug_flags_clear
00113 #define debug_flags_restore cctools_debug_flags_restore
00114 #define debug_set_flag_name cctools_debug_set_flag_name
00115 #define debug_rename cctools_debug_rename
00116
00123 void debug(INT64_T flags, const char *fmt, ...)
00124 #ifndef SWIG
00125 __attribute__ (( format(printf,2,3) ))
00126 #endif
00127 ;
00128
00136 void vdebug(INT64_T flags, const char *fmt, va_list args);
00137
00144 void warn(INT64_T flags, const char *fmt, ...);
00145
00151 void fatal(const char *fmt, ...);
00152
00158 void debug_config(const char *name);
00159
00166 void debug_config_file(const char *file);
00167
00175 void debug_config_file_size(off_t size);
00176
00177 void debug_config_fatal(void (*callback) (void));
00178
00179 void debug_config_getpid (pid_t (*getpidf)(void));
00180
00189 int debug_flags_set(const char *flagname);
00190
00197 void debug_flags_print(FILE * stream);
00198
00204 INT64_T debug_flags_clear(void);
00205
00212 void debug_set_flag_name(INT64_T flag, const char *name);
00213
00217 void debug_flags_restore(INT64_T flags);
00218
00222 void debug_rename(const char *suffix);
00223
00226 void debug_reopen(void);
00227
00228 #endif