工具类:调试

来源:互联网 发布:怎样利用网络挣钱 编辑:程序博客网 时间:2024/05/01 03:18

#define enableYLDebug 1


// debugs

#if DEBUG && enableYLDebug

#define TYLog(xx, ...) NSLog(@"%s(%d): " xx, __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)

#else

#define TYLog(xx, ...)

#endif


#if DEBUG && enableTZDebug

#define TYPrint(xx, ...) printf("%s(%d): " xx, __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)

#else

#define TYPrint(xx, ...)

#endif


#define TYPrintFrame(frame_name, frame) printf("%s - Frame(%.0f, %.0f, %.0f, %.0f)\n", frame_name, frame.origin.x, frame.origin.y, frame.size.width, frame.size.height)


#define TYCurrentThread() printf("current queue: %s\n", dispatch_queue_get_label(dispatch_get_current_queue()))


// release

#define TY_RELEASE_SAFELY(__POINTER) { [__POINTER release]; __POINTER = nil; }

#define TY_INVALIDATE_TIMER(__TIMER) { [__TIMER invalidate]; __TIMER = nil; }



#endif

原创粉丝点击