Skip to content
This repository
Browse code

Cheaper Dependencies#log_call to resolve irritating error message w/ …

…rake db:create (Sven) [#56 state:resolved]
  • Loading branch information...
commit 1eb686a0e5944d99d40bc8ab8039e4179ed78cf7 1 parent dd120ed
David Heinemeier Hansson dhh authored

Showing 1 changed file with 6 additions and 4 deletions. Show diff stats Hide diff stats

  1. +6 4 activesupport/lib/active_support/dependencies.rb
10 activesupport/lib/active_support/dependencies.rb
@@ -423,10 +423,12 @@ def remove_constant(const) #:nodoc:
423 423
424 424 protected
425 425 def log_call(*args)
426   - arg_str = args.collect(&:inspect) * ', '
427   - /in `([a-z_\?\!]+)'/ =~ caller(1).first
428   - selector = $1 || '<unknown>'
429   - log "called #{selector}(#{arg_str})"
  426 + if defined?(RAILS_DEFAULT_LOGGER) && RAILS_DEFAULT_LOGGER && log_activity
  427 + arg_str = args.collect(&:inspect) * ', '
  428 + /in `([a-z_\?\!]+)'/ =~ caller(1).first
  429 + selector = $1 || '<unknown>'
  430 + log "called #{selector}(#{arg_str})"
  431 + end
430 432 end
431 433
432 434 def log(msg)

0 comments on commit 1eb686a

Please sign in to comment.
Something went wrong with that request. Please try again.