i am trying to output a log of methods and their actions if taken and results into a "MyAppLog_ListView" the columnsHeaders of the lisftview Are
Record#______MethodName__________MethodsOutput
1 ______GetCurrentTime______success(21:10)
2 ______DoSplitString_______faild(not in right Format)
3......................................etc'...
this helps me debuging my program as it's over 1500 lines of code and atleast for me it's getting a little too complex , the question is what is the right way to store methods name in a string
public void MyMethod()
{
do stuff
if (comleted) MyAppLog_ListView_AddRecord(string for the methods name, outputSucces)
else if (faild) MyAppLog_ListView_AddRecord(string for the methods name, outputFail)
}
how do i get MyMethod().Name to store in a string ?
ReEdit :
As to SidAhmeds Answer :
public void MyMethodName() { do stuff string Mnam = MethodBase.GetCurrentMethod().Name; if (comleted) MyAppLog_ListView_AddRecord(Mnam , outputSucces); else if (faild) MyAppLog_ListView_AddRecord(Mnam , outputFail); }