* Fixed an config issue (log not initialized in RegionInfo config)

* Added LineInfo stacktrace parser to LogBase (not used yet though)
This commit is contained in:
lbsa71
2007-07-20 14:16:12 +00:00
parent 765ff13f22
commit 2da8a7c128
5 changed files with 47 additions and 2 deletions

View File

@@ -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<string> lines = new List<string>(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;
}
}
}
}