fixed log caller
This commit is contained in:
parent
a8dc1501b8
commit
30f9227913
1 changed files with 6 additions and 8 deletions
|
|
@ -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}",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue