是否可以使用NSLog语句提交iPhone应用程序二进制文件?

栏目: IOS · 发布时间: 5年前

内容简介:我即将提交我的第一个iPhone应用程序.我已经放了很多NSLog语句来测试和调试应用程序.所以我的问题是“将NSLog语句保留在源代码中是否可以”

我即将提交我的第一个iPhone应用程序.

我已经放了很多NSLog语句来测试和调试应用程序.

所以我的问题是“将NSLog语句保留在源代码中是否可以”

我怀疑nslog语句是否会减慢总执行时间.

谢谢.

我一直使用它(发现它在某处):

// DLog is almost a drop-in replacement for NSLog to turn off logging for release build
// 
// add -DDEBUG to OTHER_CFLAGS in the build user defined settings
//
// Usage:
//
// DLog();
// DLog(@"here");
// DLog(@"value: %d", x);
// Unfortunately this doesn't work DLog(aStringVariable); you have to do this instead DLog(@"%@", aStringVariable);
//

#ifdef DEBUG
#   define DLog(__FORMAT__, ...) NSLog((@"%s [Line %d] " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
#   define DLog(...) do {} while (0)
#endif
// ALog always displays output regardless of the DEBUG setting
#define ALog(__FORMAT__, ...) NSLog((@"%s [Line %d] " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)

来自Facebook的three20项目有更复杂的调试或记录方式.

翻译自:https://stackoverflow.com/questions/2207741/is-it-ok-to-submit-the-iphone-app-binary-with-nslog-statements


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

The Art of Computer Programming, Volumes 1-3 Boxed Set

The Art of Computer Programming, Volumes 1-3 Boxed Set

Donald E. Knuth / Addison-Wesley Professional / 1998-10-15 / USD 199.99

This multivolume work is widely recognized as the definitive description of classical computer science. The first three volumes have for decades been an invaluable resource in programming theory and p......一起来看看 《The Art of Computer Programming, Volumes 1-3 Boxed Set》 这本书的介绍吧!

URL 编码/解码
URL 编码/解码

URL 编码/解码

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具