Now, in order to tell your app to redirect the NSLog() outputs to a file, you should do something like this:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *fileName =[NSString stringWithFormat:@"%@.log",[NSDate date]];
NSString *logFilePath = [documentsDirectory stringByAppendingPathComponent:fileName];
freopen([logFilePath cStringUsingEncoding:NSASCIIStringEncoding],"a+",stderr);
The last sentence is the one that actually redirects the output.
So once you have done that, your app logs will be stored in the application's documents folder.
BTW: Organizer shows the console also, which has the NSLog output. The device has to be provisioned and have settings->developer settings->Logging turned on.
分享到:
相关推荐
当应用在设备中运行发生崩溃,iOS将记录这些错误日志并且创建了崩溃报告(Crash Report)。崩溃报告中包含了iOS的版本、日期、异常类型、堆栈跟踪以及其他信息。 ① 在Xcode中查看崩溃报告 当应用还在开发过程中发生...
iOS崩溃日志(崩溃报告)符号化的工具(对于OS Windows)
When using UIPageViewController, if it responds to your drag and some notification posted at the same time, you highly likely meet these crash logs: 1.Invalid Parameters count==3 2.Assertion ...
I Heart Logs.pdf I Heart Logs.pdf I Heart Logs.pdf I Heart Logs.pdf I Heart Logs.pdf I Heart Logs.pdf I Heart Logs.pdf I Heart Logs.pdf I Heart Logs.pdf I Heart Logs.pdf I Heart Logs.pdf I Heart Logs....
darks-logsdarks-logs
This practical guide shows intermediate and advanced web and mobile app developers how to build highly scalable Java applications in the cloud with Google App Engine. The flagship of Google's Cloud ...
game_logs.csv数据集
host_driver_logs_current.txt
logs.js
tomcat logs
Unity真机调试编辑器(Unity-Logs-Viewer-master),兼容iOS和Andriod系统边玩游戏面板显示Debug信息,非常方便;
Unity 免ADB真机日志查看插件分享Unity Logs Viewe。详情参看https://blog.csdn.net/wuming2016/article/details/90609787
- 每次程序启动就新建一个以当前时间命名的日志文件。...(真机连接iTunes,通过iTunes的设置->应用->文件共享,找到DebugWindow,就可以看到Logs文件夹。) - 在日志文件中搜索并高亮字符串。
阿射日志系统logs基于PHP MySQL平台开发,结构简洁,运行速度快,简体中文...1.将文件夹下所有的文件上传。 2.通过浏览器访问 ,填写配置信息进行安装。 3.安装完成,访问首页。 4.管理目录 admin/,可更改目录名。
monitor_logs:日志文件夹 存放每个脚本的日志文件 db:数据库文件夹 dbconfig.properties:数据库配置文件: dbConnectTest.sh:连接测试文件 dbExecurteSQL.sh:数据库执行SQL脚本 根据配置文件获取数据库...
logs.csv(4).xlsx
nimble-ci-logs:敏捷第三方CI日志文件夹
mod_monitor_activity 监视页面的活动。 每次访问该模块时,都会创建一个日志文件条目。 所有日志都存储在“ logs”文件夹中。
开源项目-muesli-go-app-paths.zip,go-app-paths lets you retrieve platform-specific paths, like app-data, cache, config and logs