title: How to tell which format a controller has resolved to render
body: <p>In a rails controller action with the following code:</p>
  
  <pre><code>respond_to do |format|
    format.json{ render :json=&gt;  {:status =&gt; 200, :response=&gt;@some_resource} }
    format.html { redirect_to(some_resource_path)}
  end
  </code></pre>
  
  <p>How can I log the format the controller will resolve i.e. 'HTML' or 'json'? <code>format</code> is of type <a href="https://github.com/rails/rails/blob/d42d97d2e3f0bdef2163cc14daa181903e0b198d/actionpack/lib/abstract_controller/collector.rb" rel="noreferrer">Collector</a>. Is there a way of getting a string denoting the format?</p>