diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2010-09-05 11:27:16 -0300 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-09-05 18:14:47 +0200 |
commit | c91605b15b042f6559eab71888fb679ddae4c539 (patch) | |
tree | ae7a9f985dba4c87d0a8568e818609181fc2cece /activesupport/lib/active_support | |
parent | 9a776c29782f1c3e9d81e9fe5ff488b78bd32d41 (diff) | |
download | rails-c91605b15b042f6559eab71888fb679ddae4c539.tar.gz rails-c91605b15b042f6559eab71888fb679ddae4c539.tar.bz2 rails-c91605b15b042f6559eab71888fb679ddae4c539.zip |
Refactor a bit dependencies logging
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activesupport/lib/active_support')
-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 95bb588f3f..dc6484f387 100644 --- a/activesupport/lib/active_support/dependencies.rb +++ b/activesupport/lib/active_support/dependencies.rb @@ -650,7 +650,7 @@ module ActiveSupport #:nodoc: protected def log_call(*args) - if logger && log_activity + if log_activity? arg_str = args.collect { |arg| arg.inspect } * ', ' /in `([a-z_\?\!]+)'/ =~ caller(1).first selector = $1 || '<unknown>' @@ -659,9 +659,11 @@ module ActiveSupport #:nodoc: end def log(msg) - if logger && log_activity - logger.debug "Dependencies: #{msg}" - end + logger.debug "Dependencies: #{msg}" if log_activity? + end + + def log_activity? + logger && log_activity end end end |