From 2da8a7c12818f7944ce2cc2b2cb324439e48daa2 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Fri, 20 Jul 2007 14:16:12 +0000 Subject: * Fixed an config issue (log not initialized in RegionInfo config) * Added LineInfo stacktrace parser to LogBase (not used yet though) --- OpenSim/Framework/Console/LogBase.cs | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'OpenSim/Framework/Console/LogBase.cs') diff --git a/OpenSim/Framework/Console/LogBase.cs b/OpenSim/Framework/Console/LogBase.cs index 7d38c3a..60c77fe 100644 --- a/OpenSim/Framework/Console/LogBase.cs +++ b/OpenSim/Framework/Console/LogBase.cs @@ -28,6 +28,7 @@ using System; using System.IO; using System.Net; +using System.Collections.Generic; namespace OpenSim.Framework.Console { @@ -417,5 +418,39 @@ namespace OpenSim.Framework.Console string[] cmdparams = (string[])tempstrarray; RunCmd(cmd, cmdparams); } + + public string LineInfo + { + get + { + string result = String.Empty; + + string stacktrace = Environment.StackTrace; + List lines = new List(stacktrace.Split(new string[] { "at " }, StringSplitOptions.None)); + + if (lines.Count > 4) + { + lines.RemoveRange(0, 4); + + string tmpLine = lines[0]; + + int inIndex = tmpLine.IndexOf(" in "); + + if (inIndex > -1) + { + result = tmpLine.Substring(0, inIndex); + + int lineIndex = tmpLine.IndexOf(":line "); + + if (lineIndex > -1) + { + lineIndex += 6; + result += ", line " + tmpLine.Substring(lineIndex, (tmpLine.Length - lineIndex) - 5); + } + } + } + return result; + } + } } } -- cgit v1.1