aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Console/LogBase.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Console/LogBase.cs')
-rw-r--r--OpenSim/Framework/Console/LogBase.cs35
1 files changed, 35 insertions, 0 deletions
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 @@
28using System; 28using System;
29using System.IO; 29using System.IO;
30using System.Net; 30using System.Net;
31using System.Collections.Generic;
31 32
32namespace OpenSim.Framework.Console 33namespace OpenSim.Framework.Console
33{ 34{
@@ -417,5 +418,39 @@ namespace OpenSim.Framework.Console
417 string[] cmdparams = (string[])tempstrarray; 418 string[] cmdparams = (string[])tempstrarray;
418 RunCmd(cmd, cmdparams); 419 RunCmd(cmd, cmdparams);
419 } 420 }
421
422 public string LineInfo
423 {
424 get
425 {
426 string result = String.Empty;
427
428 string stacktrace = Environment.StackTrace;
429 List<string> lines = new List<string>(stacktrace.Split(new string[] { "at " }, StringSplitOptions.None));
430
431 if (lines.Count > 4)
432 {
433 lines.RemoveRange(0, 4);
434
435 string tmpLine = lines[0];
436
437 int inIndex = tmpLine.IndexOf(" in ");
438
439 if (inIndex > -1)
440 {
441 result = tmpLine.Substring(0, inIndex);
442
443 int lineIndex = tmpLine.IndexOf(":line ");
444
445 if (lineIndex > -1)
446 {
447 lineIndex += 6;
448 result += ", line " + tmpLine.Substring(lineIndex, (tmpLine.Length - lineIndex) - 5);
449 }
450 }
451 }
452 return result;
453 }
454 }
420 } 455 }
421} 456}