diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-04-30 23:20:59 -0500 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-04-30 23:20:59 -0500 |
commit | 1eb686a0e5944d99d40bc8ab8039e4179ed78cf7 (patch) | |
tree | e15f29a27e59441a6bd309be32ddc246e108bc1a /activesupport | |
parent | dd120ede53eaf71dee76894998a81626b7a689fc (diff) | |
download | rails-1eb686a0e5944d99d40bc8ab8039e4179ed78cf7.tar.gz rails-1eb686a0e5944d99d40bc8ab8039e4179ed78cf7.tar.bz2 rails-1eb686a0e5944d99d40bc8ab8039e4179ed78cf7.zip |
Cheaper Dependencies#log_call to resolve irritating error message w/ rake db:create (Sven) [#56 state:resolved]
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/dependencies.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb index 64b2248e28..70b34c90e8 100644 --- a/activesupport/lib/active_support/dependencies.rb +++ b/activesupport/lib/active_support/dependencies.rb @@ -423,10 +423,12 @@ module Dependencies #: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) |