From: James Moore Date: 2007-07-17T01:20:51+09:00 Subject: Re: Accessing the name of the current function The caller() method has what you're looking for. Here's my equivalent of what you do: dbg 'some stuff', an_object def dbg *args if ENV['RAILS_ENV'] == 'test' stack = caller(1).slice(0, 5) $stdout << "==========================\n" pp(*args) stack.each do |s| puts s end end end - James Moore