I have a class with several methods and I want to write my own log-file which tells me if the executed methods threw an error or not. I have a function to save a success-parameter, with a timestamp and the name of the executed method, but how do I get the name of the running method to pass it to the log-function?
I know that I could just type in the name of the method in the function call by hand for every method, but I'm hoping for a better solution.
function test( obj )
write2log( 'test' );
mfilename does not work because it will only give me the name of the m-file, which is the name of the whole class.
Thanks for your help,
(MATLAB version: Matlab R2016b)