有一种方法可以在调试会话期间按类和方法名称跟踪/跟踪并记录所有方法? [英] Is there a way to Track/trace and log all the methods, by Class and Method name, during a debug session?

查看:115
本文介绍了有一种方法可以在调试会话期间按类和方法名称跟踪/跟踪并记录所有方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不喜欢登录到框架或封面,而是在进入和退出每个方法时仅在我的源代码级别。我希望它提供类名称和方法名称,并将其记录到文件中,或至少让它在屏幕上飞行。

I am not interested in logging into frameworks or under the covers but only at my source level code upon entry and exit of each method. I would like it to provide Class Name and Method Name and log it to file or at least have it fly by on the screen.

我的查询是否可以现有的Xcode / Debugger / Instruments设备,我可以在每个方法进入和退出时以简单的方式实现NSLog语句,还是提供这种功能的商业工具?

My query is if it is possible with existing Xcode/Debugger/Instruments facilities, can I implement it in an easy way other than an NSLog statement at every method entry and exit, or is there a commercial tool that provides this capability ?

我在这里谈论源代码方法,而不是执行进程或线程。谢谢。

I'm talking source methods here... not execution processes or threads. Thanks.

推荐答案

Dave Dribin在他的文章追踪Objective-C消息

Dave Dribin covers precisely this in his article Tracing Objective-C messages.

之后可能是这样的:


如果将 NSObjCMessageLoggingEnabled 环境变量设置为 YES ,Objective-C运行时将所有发送的Objective-C消息记录到名为/ tmp / msgSends-< pid>的文件。

If you set the NSObjCMessageLoggingEnabled environment variable to YES, the Objective-C runtime will log all dispatched Objective-C messages to a file named /tmp/msgSends-<pid>.

这篇关于有一种方法可以在调试会话期间按类和方法名称跟踪/跟踪并记录所有方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆