Navigation


Changeset 205:ff9ade352076 in freeDiameter for include


Ignore:
Timestamp:
Feb 12, 2010, 6:29:08 PM (14 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Simplified use of --dbg_file option

File:
1 edited

Legend:

Unmodified
Added
Removed
  • include/freeDiameter/libfreeDiameter.h

    r191 r205  
    7171#include <unistd.h>
    7272
     73#ifdef DEBUG
     74#include <libgen.h>     /* for basename if --dbg_file is specified */
     75#endif /* DEBUG */
     76
    7377/*============================================================*/
    7478/*                          DEBUG                             */
     
    167171#endif /* __PRETTY_FUNCTION__ */
    168172
     173/* A version of __FILE__ without the full path */
     174static char * file_bname = NULL;
     175#define __STRIPPED_FILE__       (file_bname ?: (file_bname = basename(__FILE__)))
     176
    169177/* Boolean for tracing at a certain level */
     178#ifdef DEBUG
    170179#define TRACE_BOOL(_level_) ( ((_level_) <= local_debug_level + fd_g_debug_lvl)                                         \
    171180                                || (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 */
    173185
    174186/* 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.