Skip to content

Commit

Permalink
skip logging render partial in production
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Nov 5, 2012
1 parent 0d2bfd9 commit 440306e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions 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.