emailservices/emaildebug/inc/emailtrace.h
changeset 43 99bcbff212ad
parent 40 2c62ef3caffd
child 44 c2d07d913565
equal deleted inserted replaced
42:139d4b7b2938 43:99bcbff212ad
    56 #endif
    56 #endif
    57 
    57 
    58 #endif /* DEBUG */
    58 #endif /* DEBUG */
    59 
    59 
    60 /*
    60 /*
    61  * The function NM_COMMENT() prints a trace message. The INFO macros are
    61  * The function NM_COMMENT() prints a trace message. The INFO macros and the
    62  * provided for legacy compatibility. They are deprecated and should not be
    62  * NMLOG macro are provided for legacy compatibility. They are deprecated and
    63  * used. If sprintf() type of formatting is desired, consider using QString::
    63  * should not be used. If sprintf() type of formatting is desired, consider
    64  * arg() or QTextStream.
    64  * using QString::arg() or QTextStream.
    65  */
    65  */
    66 #if COMMENT_TRACES
    66 #if COMMENT_TRACES
    67 
    67 
    68 inline void NM_COMMENT(const QString& msg)
    68 inline void NM_COMMENT(const QString& msg)
    69 {
    69 {
    86 do {\
    86 do {\
    87     QString __msg;\
    87     QString __msg;\
    88     __msg.sprintf(msg,arg1,arg2,arg3);\
    88     __msg.sprintf(msg,arg1,arg2,arg3);\
    89     NM_COMMENT(__msg);\
    89     NM_COMMENT(__msg);\
    90 } while (0)
    90 } while (0)
       
    91 #define NMLOG(msg) NM_COMMENT(msg)
    91 
    92 
    92 #else
    93 #else
    93 
    94 
    94 #define NM_COMMENT(msg)
    95 #define NM_COMMENT(msg)
    95 #define INFO(msg)
    96 #define INFO(msg)
    96 #define INFO_1(msg,arg1)
    97 #define INFO_1(msg,arg1)
    97 #define INFO_2(msg,arg1,arg2)
    98 #define INFO_2(msg,arg1,arg2)
    98 #define INFO_3(msg,arg1,arg2,arg3)
    99 #define INFO_3(msg,arg1,arg2,arg3)
       
   100 #define NMLOG(msg)
    99 
   101 
   100 #endif /* COMMENT_TRACES */
   102 #endif /* COMMENT_TRACES */
   101 
   103 
   102 /*
   104 /*
   103  * The function NM_ERROR() prints its second argument if the first argument
   105  * The function NM_ERROR() prints its second argument if the first argument
   175     }
   177     }
   176 private:
   178 private:
   177     QString fn;
   179     QString fn;
   178 };
   180 };
   179 
   181 
   180 #define NM_FUNCTION __ftracer __ft(__PRETTY_FUNCTION__);
   182 #define NM_FUNCTION __ftracer __ft(__PRETTY_FUNCTION__)
   181 #define FUNC_LOG NM_FUNCTION
   183 #define FUNC_LOG NM_FUNCTION
   182 
   184 
   183 #else
   185 #else
   184 
   186 
   185 #define NM_FUNCTION
   187 #define NM_FUNCTION