Changeset 205:ff9ade352076 in freeDiameter
- Timestamp:
- Feb 12, 2010, 6:29:08 PM (14 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
freeDiameter/main.c
r174 r205 234 234 235 235 case 'f': /* Full debug for the function with this name. */ 236 #ifdef DEBUG 236 237 fd_debug_one_function = optarg; 238 #else /* DEBUG */ 239 TRACE_DEBUG(INFO, "Error: must compile with DEBUG support to use this feature"); 240 return EINVAL; 241 #endif /* DEBUG */ 237 242 break; 238 243 239 244 case 'F': /* Full debug for the file with this name. */ 240 fd_debug_one_file = optarg; 245 #ifdef DEBUG 246 fd_debug_one_file = basename(optarg); 247 #else /* DEBUG */ 248 TRACE_DEBUG(INFO, "Error: must compile with DEBUG support to use this feature"); 249 return EINVAL; 250 #endif /* DEBUG */ 241 251 break; 242 252 -
include/freeDiameter/libfreeDiameter.h
r191 r205 71 71 #include <unistd.h> 72 72 73 #ifdef DEBUG 74 #include <libgen.h> /* for basename if --dbg_file is specified */ 75 #endif /* DEBUG */ 76 73 77 /*============================================================*/ 74 78 /* DEBUG */ … … 167 171 #endif /* __PRETTY_FUNCTION__ */ 168 172 173 /* A version of __FILE__ without the full path */ 174 static char * file_bname = NULL; 175 #define __STRIPPED_FILE__ (file_bname ?: (file_bname = basename(__FILE__))) 176 169 177 /* Boolean for tracing at a certain level */ 178 #ifdef DEBUG 170 179 #define TRACE_BOOL(_level_) ( ((_level_) <= local_debug_level + fd_g_debug_lvl) \ 171 180 || (fd_debug_one_function && !strcmp(fd_debug_one_function, __PRETTY_FUNCTION__)) \ 172 || (fd_debug_one_file && !strcmp(fd_debug_one_file, __FILE__) ) ) 181 || (fd_debug_one_file && !strcmp(fd_debug_one_file, __STRIPPED_FILE__) ) ) 182 #else /* DEBUG */ 183 #define TRACE_BOOL(_level_) ((_level_) <= local_debug_level + fd_g_debug_lvl) 184 #endif /* DEBUG */ 173 185 174 186 /* The general debug macro, each call results in two lines of debug messages (change the macro for more compact output) */
Note: See TracChangeset
for help on using the changeset viewer.