> -define(FUNCTION, hd(element(2,element(2,catch erlang:error([]))))). A safer solution (it has no side effects, unlike the above): -define(FUNCTION,element(2,process_info(self(),current_function))). I don't know if it's more expensive or not, but if it does matter, you're doing something wrong. Georgy