I tweaked the code a bit to be not "WhoCalledMe" but rather "WhoIsTheCallerOfMe" and as such could hide most of the logging in a base class. This is easily done by changing the row
StackFrame stackFrame = stackTrace.GetFrame(1);to
StackFrame stackFrame = stackTrace.GetFrame(2);Of course then you'll have to check that the frame in question (2) exists.
No comments:
Post a Comment