Permalink
Browse files

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

…rake db:create (Sven) [#56 state:resolved]
  • Loading branch information...
1 parent dd120ed commit 1eb686a0e5944d99d40bc8ab8039e4179ed78cf7 @dhh dhh committed May 1, 2008
Showing with 6 additions and 4 deletions.
  1. +6 −4 activesupport/lib/active_support/dependencies.rb
View
10 activesupport/lib/active_support/dependencies.rb
@@ -423,10 +423,12 @@ def remove_constant(const) #:nodoc:
protected
def log_call(*args)
- arg_str = args.collect(&:inspect) * ', '
- /in `([a-z_\?\!]+)'/ =~ caller(1).first
- selector = $1 || '<unknown>'
- log "called #{selector}(#{arg_str})"
+ if defined?(RAILS_DEFAULT_LOGGER) && RAILS_DEFAULT_LOGGER && log_activity
+ arg_str = args.collect(&:inspect) * ', '
+ /in `([a-z_\?\!]+)'/ =~ caller(1).first
+ selector = $1 || '<unknown>'
+ log "called #{selector}(#{arg_str})"
+ end
end
def log(msg)

0 comments on commit 1eb686a

Please sign in to comment.