自定义的打印宏

来源:互联网 发布:matlab求矩阵的行列式 编辑:程序博客网 时间:2024/06/01 08:03

#define DebugLogEnable 1


#if DebugLogEnable

   #define macro_to_str1(x) #x


   #define macro_to_str(x) macro_to_str1(x)


    #define DebugString(format,...)      ([NSString stringWithFormat: @" %s  %@ ", __FUNCTION__, [NSString stringWithFormat:format, ##__VA_ARGS__]])


    #define xsyLog(format, ...)          NSLog(@"%@",DebugString(format, ##__VA_ARGS__))


    #define xsyLogError(error)           xsyLog(@"error:%@",error)


    #define xsyLogMethod()               xsyLog(@"")


#else


    #define DebugString(format,...)      @""


    #define xsyLog(format, ...)


    #define xsyLogError(error)


    #define xsyLogMethod()   


    #define NSLog(...)


#endif

0 0
原创粉丝点击