aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Framework/Util.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index a0c54a0..0c657c5 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -1855,6 +1855,12 @@ namespace OpenSim.Framework
1855 /// </summary> 1855 /// </summary>
1856 public static void PrintCallStack() 1856 public static void PrintCallStack()
1857 { 1857 {
1858 PrintCallStack(m_log.DebugFormat);
1859 }
1860
1861 public delegate void DebugPrinter(string msg, params Object[] parm);
1862 public static void PrintCallStack(DebugPrinter printer)
1863 {
1858 StackTrace stackTrace = new StackTrace(true); // get call stack 1864 StackTrace stackTrace = new StackTrace(true); // get call stack
1859 StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames) 1865 StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames)
1860 1866
@@ -1862,7 +1868,7 @@ namespace OpenSim.Framework
1862 foreach (StackFrame stackFrame in stackFrames) 1868 foreach (StackFrame stackFrame in stackFrames)
1863 { 1869 {
1864 MethodBase mb = stackFrame.GetMethod(); 1870 MethodBase mb = stackFrame.GetMethod();
1865 m_log.DebugFormat("{0}.{1}:{2}", mb.DeclaringType, mb.Name, stackFrame.GetFileLineNumber()); // write method name 1871 printer("{0}.{1}:{2}", mb.DeclaringType, mb.Name, stackFrame.GetFileLineNumber()); // write method name
1866 } 1872 }
1867 } 1873 }
1868 1874