I am writing a log class in C # and would like to add the method from which the log call was made. Doing this manually is not too attractive. Is there a way to find out which method is in the current executable code?
Thanks in advance for your awesomeness ...
Gregg
EDIT: Using MethodBase ...
System.Reflection.MethodBase thisMethod = System.Reflection.MethodBase.GetCurrentMethod(); Console.WriteLine("This method is: " + thisMethod.Name);
source share