Ronald Fischer
7/16/2007 2:56:00 PM
Is there away to access the name of the currently defined function?
Example: Right now I do tracing like this:
def myfunc(a,b)
trace.debug "ENTER myfunc a=#{a} b=#{b}"
....
trace.debug "LEAVE myfunc result=#{result}"
result
end
If I rename myfunc, I also have to change the word myfunc in the
trace statements. It would be convenient to have something like
trace.debug "ENTER #{__function__} a=#{a} b=#{b}"
Maybe Ruby already provides such a feature, and I just don't know it...
Ronald
--
Ronald Fischer <ronald.fischer@venyon.com>
Phone: +49-89-452133-162