在运行时获取本地对象/变量的列表 [英] Get list of local objects/variables during runtime
问题描述
我正在尝试创建一个简单的记录器来检查客户端发生的情况。如何获取当地人的列表(如调试时在visual studio中显示的)?
类似于当断点被击中时,当前现有的对象/变量实例在本地选项卡上显示,或者只要在日志上写入变量的当前值?
有趣的事情。 .. / p>
我通常用反射和运行时数据的组合记录所有方法参数的名称和值,从来没有想过也捕捉到局部变量值...
这里有一些信息:
I'm trying to create a simple logger to check what's happening on the client-side. How can I get the list of locals (as displayed on visual studio while debugging)?
kind of like when a breakpoint is hit, the current existing instances of objects/variables are shown on the Locals tab or should I just get the variable's current value whenever I write on the log?
Interesting thing...
I usually log all method parameters names and values with a combination of Reflection and runtime data, never thought about also catching local variables values...
here some info:
Accessing Local Variable Information
这篇关于在运行时获取本地对象/变量的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!