Navigation


Changeset 1134:51ce5a30df2d in freeDiameter for include


Ignore:
Timestamp:
May 15, 2013, 4:41:48 PM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Children:
1135:90e0382e6579, 1137:35363aac8dd6
Phase:
public
Message:

Fix the dbg_func and dbg_file parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • include/freeDiameter/libfdproto.h

    r1122 r1134  
    457457} MARK_DEPRECATED;
    458458
    459 static __inline__ int TRACE_BOOL( enum old_levels level ) MARK_DEPRECATED
    460 {
    461         return (level <= fd_g_debug_lvl)
    462                 || (fd_debug_one_function && !strcmp(fd_debug_one_function, __PRETTY_FUNCTION__))
    463                 || (fd_debug_one_file && !strcmp(fd_debug_one_file, __STRIPPED_FILE__) );
     459static __inline__ int old_TRACE_BOOL( enum old_levels level, const char * file, const char * func ) MARK_DEPRECATED
     460{
     461        if ((fd_debug_one_function && !strcmp(fd_debug_one_function, func))
     462                || (fd_debug_one_file && !strcmp(fd_debug_one_file, file) ))
     463                return 2; /* Level override */
     464        if (level <= fd_g_debug_lvl)
     465                return 1; /* Normal level */
     466        return 0;  /* No trace */
    464467}
     468#define TRACE_BOOL(level)  old_TRACE_BOOL((level), __STRIPPED_FILE__, __PRETTY_FUNCTION__)
    465469
    466470#ifndef SWIG
     
    488492/* old macro for traces. To be replaced by appropriate LOG_* macros. */
    489493# define TRACE_DEBUG(oldlevel, format,args... ) {                                       \
    490                 if (TRACE_BOOL(oldlevel)) {                                             \
     494                int __l__;                                                              \
     495                if ((__l__ = TRACE_BOOL(oldlevel))) {                                   \
    491496                        if      (oldlevel <= NONE) { LOG_E(format,##args); }            \
    492497                        else if (oldlevel <= INFO) { LOG_N(format,##args); }            \
     498                        else if (__l__ == 2)       { LOG_N(format,##args); }            \
    493499                        else if (oldlevel <= FULL) { LOG_D(format,##args); }            \
    494500                        else                       { LOG_A(format,##args); }            \
Note: See TracChangeset for help on using the changeset viewer.