Browse files

skip logging render partial in production

  • Loading branch information...
1 parent 0d2bfd9 commit 440306ea864c728766fc8c5ca9c1f3a641b8e7bd @mislav committed Nov 5, 2012
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

0 comments on commit 440306e

Please sign in to comment.