Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

skip logging render partial in production

  • Loading branch information...
commit 440306ea864c728766fc8c5ca9c1f3a641b8e7bd 1 parent 0d2bfd9
@mislav authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 config/initializers/render_partial_logger_patch.rb
View
12 config/initializers/render_partial_logger_patch.rb
@@ -0,0 +1,12 @@
+ActiveSupport.on_load(:action_view) do
+ ActionView::LogSubscriber.class_eval do
+ undef render_partial
+ def render_partial event
+ render_template event if log_render_partial?
+ end
+
+ def log_render_partial?
+ logger and logger.level <= ::Logger::DEBUG
+ end
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.