zoukankan      html  css  js  c++  java
  • 记录调试树(方便跟到具体的调用)

       public static void DebugFunctionTree(string message)
            {
                try
                {
                    System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace();
                    System.Diagnostics.StackFrame[] sfs = st.GetFrames();
                    StringBuilder sb = new StringBuilder();
                    for (int u = 1; u < sfs.Length; ++u)
                    {
                        System.Reflection.MethodBase mb = sfs[u].GetMethod();
                        string pms = string.Empty;
                        foreach (var p in mb.GetParameters())
                        {
     
                            pms += p.ParameterType.FullName + ":" + p.Name + ",";
                        }
                        sb.AppendLine(string.Format("[方法调用树][{0}]: {1}.{2} 参数:{3}", u, mb.DeclaringType.FullName, mb.Name, pms));
                    }
                    XX.General.Exception.Debug(message+"-开始");
                    XX.General.Exception.Debug(sb.ToString());
                    XX.General.Exception.Debug(message + "-结束");
                }
                catch (Exception)
                {
                    
                }       

            }

  • 相关阅读:
    JEDEC标准(JESD216)S FDP对串行Flash在系统中的应用
    Gerrit使用简介
    Gerrit2安装配置
    SSH原理与运用(二):远程操作与端口转发
    SSH原理与运用(一):远程登录
    常用的几个工具网站
    MQTT、CoAP
    Gerrit代码Review实战
    net share
    Gitlab+Gerrit+Jenkins完整对接
  • 原文地址:https://www.cnblogs.com/viaiu/p/5104572.html
Copyright © 2011-2022 走看看