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)
                {
                    
                }       

            }

  • 相关阅读:
    js+canvas画随机4位验证码
    linux 下 查看 nginx 日志中访问前10 的 ip
    mysql greatest函数
    php 如何获取 post 传递的raw 数据
    php 监控文件变化 并上传到服务器
    php 如何统计本周 本月
    Yii2.0 GridView 的强大功能
    git 导出新修改的文件
    ubuntu16.04 下安装phpMyAdmin
    如何在ubuntu16.04 上搭建 phpstorm + xdebug 调试
  • 原文地址:https://www.cnblogs.com/viaiu/p/5104572.html
Copyright © 2011-2022 走看看