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

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

内容简介:我即将提交我的第一个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


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

查看所有标签

猜你喜欢:

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

JavaScript: The Definitive Guide, 5th Edition

JavaScript: The Definitive Guide, 5th Edition

David Flanagan / O'Reilly Media / 2006-08-01 / USD 49.99

This Fifth Edition is completely revised and expanded to cover JavaScript as it is used in today's Web 2.0 applications. This book is both an example-driven programmer's guide and a keep-on-your-desk ......一起来看看 《JavaScript: The Definitive Guide, 5th Edition》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

SHA 加密
SHA 加密

SHA 加密工具