See this example:
''//file1.vb Sub Something() ''//... Functions.LogInfo('some text') ''//... End Sub ''//functions.vb Sub LogInfo(ByVal entry as String) Console.WriteLine(entry) End Sub
Can I get the the name ‘Something’ inside LogInfo?
Sorry for the briefness of this post, I am not sure how to properly articulate this question. I will clarify and elaborate as needed.
(EDIT: Removed unnecessary use of
StackTraceitself – which would be useful if you wanted to print out more info than just one frame.)You can use the
StackFrameclass, but it’s pretty expensive (IIRC) and may be slightly incorrect due to inlining.EDIT: Something like this: (the NoInlining is to make sure it behaves properly…)