- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试跟踪复杂 Python 应用程序 (OpenERP) 中的调用和代码流。更复杂的是,OpenERP 有自己的继承系统,与普通的 Python 继承并行。
我想做的是拥有一个完整的执行代码列表,以及模块/函数名称。
我已经尝试过 Eclipse 调试器,我知道 pdb 的工作方式大致相同,但是单步执行过程花费的时间太长。
我也曾尝试使用跟踪启动应用程序,但在我想要跟踪的点之前收到了太多不必要的跟踪。我确实尝试排除模块和目录,但没有太大帮助。
python -m trace -t --ignore-dir=/home/sean/unifield/utp729b/unifield-server --ignore-dir=/home/sean/unifield/utp729b/unifield-web --ignore-module=SocketServer,socket,threading,tiny_socket,__init__,trace,netsvc,posixpath,zipfile,config,genericpath,orm openerp-server.py --db_host=localhost --db_port=5432 --db_user=openerp --db_password=xxxx --addons-path=/home/sean/unifield/utp729b/unifield-addons,/home/sean/unifield/utp729b/sync_module_prod,/home/sean/unifield/utp729b/unifield-wm > /home/sean/trace.log
我想做的是在代码中设置一个断点,但不是然后单步执行代码,而是开始记录到一个文件。
我还尝试使用装饰器,并举例说明 http://eli.thegreenplace.net/2012/08/22/easy-tracing-of-nested-function-calls-in-python/和 http://code.activestate.com/recipes/577551/ ,但它们没有满足我的需求。
编辑
我现在已经尝试使用 Python 跟踪模块,方法是将此行添加到 Eclipse 中的 VM Arguements 框中:-m trace -t --trace
这开始产生我正在寻找的东西,逐行跟踪,但是当 OpenERP 完全启动时停止工作。请参阅下面控制台输出的(冗长)摘录。
pydevd_tracing.py(46): if TracingFunctionHolder._warn:
pydevd_tracing.py(62): TracingFunctionHolder._original_tracing(tracing_func)
pydevd_tracing.py(69): TracingFunctionHolder._warn = True
pydevd_tracing.py(71): TracingFunctionHolder._lock.release()
pydevd.py(1075): try:
pydevd.py(1077): threading.settrace(self.trace_dispatch) # for all future threads
pydevd.py(1081): try:
pydevd.py(1082): thread.start_new_thread = pydev_start_new_thread
pydevd.py(1083): thread.start_new = pydev_start_new_thread
pydevd.py(1087): while not self.readyToRun:
pydevd.py(1088): time.sleep(0.1) # busy wait until we receive run command
pydevd.py(1087): while not self.readyToRun:
pydevd.py(1088): time.sleep(0.1) # busy wait until we receive run command
pydevd.py(1087): while not self.readyToRun:
pydevd.py(1088): time.sleep(0.1) # busy wait until we receive run command
pydevd.py(1087): while not self.readyToRun:
pydevd.py(1088): time.sleep(0.1) # busy wait until we receive run command
pydevd.py(1087): while not self.readyToRun:
pydevd.py(1088): time.sleep(0.1) # busy wait until we receive run command
pydevd.py(1087): while not self.readyToRun:
pydevd.py(1088): time.sleep(0.1) # busy wait until we receive run command
pydevd.py(1087): while not self.readyToRun:
pydevd.py(1090): PyDBCommandThread(debugger).start()
pydevd.py(1092): pydev_imports.execfile(file, globals, locals) #execute the script
[2014-01-05 18:33:51,992][?] INFO:server:OpenERP version - 6.0.3
[2014-01-05 18:33:51,993][?] INFO:server:addons_path - /home/sean/unifield/utp729b/unifield-addons,/home/sean/unifield/utp729b/sync_module_prod,/home/sean/unifield/utp729b/unifield-wm
[2014-01-05 18:33:51,993][?] INFO:server:database hostname - localhost
[2014-01-05 18:33:51,993][?] INFO:server:database port - 5432
[2014-01-05 18:33:51,994][?] INFO:server:database user - openerp
[2014-01-05 18:33:51,994][?] INFO:server:initialising distributed objects services
[2014-01-05 18:33:52,316][?] INFO:web-services:starting HTTP service at 0.0.0.0 port 8069
[2014-01-05 18:33:52,316][?] INFO:web-services:starting HTTPS service at 0.0.0.0 port 8071
[2014-01-05 18:33:52,317][?] INFO:web-services:Registered XML-RPC over HTTP
[2014-01-05 18:33:52,318][?] INFO:web-services:starting NET-RPC service at 0.0.0.0 port 8070
[2014-01-05 18:33:52,318][?] INFO:server:Starting 3 services
[2014-01-05 18:33:52,319][?] INFO:server:OpenERP server is running, waiting for connections...
[2014-01-05 18:34:02,476][utp729b_HQ_01] INFO:init:module base: loading objects
[2014-01-05 18:34:02,478][utp729b_HQ_01] INFO:init:module base: registering objects
[2014-01-05 18:34:03,060][utp729b_HQ_01] INFO:init:module base: loading objects
[2014-01-05 18:34:03,185][utp729b_HQ_01] INFO:init:module msf_button_access_rights: loading objects
[2014-01-05 18:34:03,186][utp729b_HQ_01] INFO:init:module msf_button_access_rights: registering objects
[2014-01-05 18:34:03,203][utp729b_HQ_01] INFO:init:module spreadsheet_xml: loading objects
编辑 2
查看更强大的解决方案,但始终运行而不是某个时间点,此处:Finding full pathname in a Python trace
最佳答案
我不知道如何像您想要的那样设置跟踪;我所能提供的是,大多数与数据存储和检索相关的有趣调用都通过 osv.py
、fields.py
和 orm.py
在 .../openerp/osv/
目录中。
关于python - 从代码中的一个点跟踪所有语句,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20706614/
有没有办法在 xdebug 跟踪输出中查看 echo 或 print 函数调用。我正在为我在我的服务器中运行的所有脚本寻找一个全局配置(或一种方法)。 例子: 我希望跟踪输出显示 echo 调用。默
我将应用程序从2.0.0M2升级到了2.1.0,但是当我尝试运行该应用程序时,出现此错误: Note: /Volumes/Info/proyectos-grails/vincoorbis/Member
我如何在共享点中执行日志记录。我想使用跟踪。 以便它记录 12 个配置单元日志。 最佳答案 微软提供了一个例子: http://msdn.microsoft.com/en-us/library/aa9
如何跟踪 eclipse 和 android 模拟器的输出。我习惯于在 Flash 和 actionscript 中这样做。 在 AS3 中它将是: trace('我的跟踪语句'); 最佳答案 您有几
是否可以在 Postgresql 上进行查询跟踪?我在带有 OLEDB 界面的 Windows 上使用 9.0。 此外,我需要它是实时的,而不是像默认情况下那样缓冲... 最佳答案 我假设您的意思是在
第一天 HaxeFlixel 编码器。愚蠢的错误,但谷歌没有帮助我。 如何使用 Haxe、NME 和 Flixel 追踪到 FlashDevelop 输出。它在使用 C++ 执行时有效,但对 Flas
我有一个关于 iPhone 上跟踪触摸的快速问题,我似乎无法就此得出结论,因此非常感谢任何建议/想法: 我希望能够跟踪和识别 iPhone 上的触摸,即。基本上每次触摸都有一个起始位置和当前/移动位置
我正在做我的大学项目,我只想跟踪错误及其信息。错误信息应该与用户源设备信息一起存储在数据库中(为了检测源设备,我正在使用MobileDetect扩展名)。我只想知道应该在哪里编写代码,以便获得所有错误
我正在 Azure 中使用多个资源,流程如下所示: 从 sftp 获取文件 使用 http 调用的数据丰富文件 将消息放入队列 处理消息 调用一些外部电话 传递数据 我们如何跟踪上述过程中特定“运行”
在我的 WCF 服务中,当尝试传输大数据时,我不断收到错误:底层连接已关闭:连接意外关闭 我想知道引发此错误的具体原因,因此我设置了 WCF 跟踪并可以读取 traces.svclog 文件。 问题是
我的目标是在 Firebase Analytics 中获取应用数据,在 Google Universal Analytics 中获取其他自定义数据和应用数据。 我的问题是我是否在我的应用上安装 Fir
我正在 Azure 中使用多个资源,流程如下所示: 从 sftp 获取文件 使用 http 调用的数据丰富文件 将消息放入队列 处理消息 调用一些外部电话 传递数据 我们如何跟踪上述过程中特定“运行”
我们正在考虑跟踪用户通过 Tridion 管理的网站的旅程的要求,然后能够根据此行为将此用户识别为“潜在客户”,然后如果他们在之后没有返回,则触发向此用户发送电子邮件X 天。 SmartTarget
在 Common Lisp 中,函数(跟踪名称)可用于查看有关函数调用的输出。 如果我的函数是用局部作用域声明的,我如何描述它以进行跟踪? 例如,如何跟踪栏,如下: (defun foo (x)
有什么方法可以检测文本框的值是否已更改,是用户明确更改还是某些 java 脚本代码修改了文本框?我需要检测这种变化。 最佳答案 要跟踪用户更改,您可以添加按键处理程序: $(selector).key
int Enable ( int pid) { int status; #if 1 { printf ( "child pid = %d \n", pid ); long ret =
关闭。这个问题需要多问focused 。目前不接受答案。 想要改进此问题吗?更新问题,使其仅关注一个问题 editing this post . 已关闭 9 年前。 Improve this ques
我有以下测试代码: #include int main(void) { fprintf(stderr, "This is a test.\n"); int ret = open("s
我有一个闭源 Java 应用程序,供应商已为其提供了用于自定义的 API。由于我没有其他文档,我完全依赖 API 的 javadoc。 我想跟踪特定用例在不同类中实际调用的方法。有什么办法可以用 ec
我正在学习 PHP。我在我的一个 php 函数中使用了如下所示的 for 循环。 $numbers = $data["data"]; for ($i = 0;$i send($numbers[
我是一名优秀的程序员,十分优秀!