Difference between NSLog and DLog

后端 未结 5 1423
栀梦
栀梦 2020-12-08 07:25

Can anyone tell me what the difference is between NSLog and DLog?

I found about this DLog when I was looking over this project code: http:/

5条回答
  •  遥遥无期
    2020-12-08 08:14

    DLog is a macro meant to conditionalize the behavior of NSLog() in debug and release builds. For release builds it will print nothing. NSLog() is meant to print format strings to the console.

    Here is its definition for reference:

    #ifdef DEBUG
    #    define DLog(...) NSLog(__VA_ARGS__)
    #else
    #    define DLog(...) /* */
    #endif
    #define ALog(...) NSLog(__VA_ARGS__)
    

提交回复
热议问题