title: How to retrieve the current method name so to output it to the logger file?
body: <p>I am using Ruby on Rails 3.2.2 and, in order to display warning messages for development purposes, I am using <code>logger.warn</code> in my code. I would like to retrieve the <em>method name</em> in which that <code>logger.warn</code> runs so to output that method name to the log file.</p>
  
  <pre><code>class ClassName &lt; ActiveRecord::Base
    def method_name
      # Note: This code doesn't work. It is just a sample.
      logger.warn "I would like to retrieve and display the #{self.class.to_s}##{method_name}"
    end
  end
  </code></pre>
  
  <p>In the log file I would like to see:</p>
  
  <blockquote>
    <p>I would like to retrieve and display the ClassName#method_name</p>
  </blockquote>
  
  <p>Is it possible? If so, how can I make that?</p>