fixed log caller

This commit is contained in:
high 2011-06-20 17:22:39 -04:00
parent a8dc1501b8
commit 30f9227913

View file

@ -117,16 +117,14 @@ namespace TShockAPI
return; return;
} }
StackTrace trace = new StackTrace(); string caller = "TShock";
StackFrame frame = null;
frame = trace.GetFrame(2); StackFrame frame = new StackTrace().GetFrame(2);
if (frame != null)
string caller = "TShock: ";
if (frame != null && frame.GetMethod().DeclaringType != null)
{ {
caller += frame.GetMethod().DeclaringType.Name + ": "; var meth = frame.GetMethod();
if (meth != null)
caller = meth.DeclaringType.Name;
} }
_logWriter.WriteLine(string.Format("{0} - {1}: {2}: {3}", _logWriter.WriteLine(string.Format("{0} - {1}: {2}: {3}",