Browse files

Refactor a bit dependencies logging

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
1 parent 9a776c2 commit c91605b15b042f6559eab71888fb679ddae4c539 @carlosantoniodasilva carlosantoniodasilva committed with josevalim Sep 5, 2010
Showing with 6 additions and 4 deletions.
  1. +6 −4 activesupport/lib/active_support/dependencies.rb
View
10 activesupport/lib/active_support/dependencies.rb
@@ -650,7 +650,7 @@ def remove_constant(const) #: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 @@ def log_call(*args)
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

0 comments on commit c91605b

Please sign in to comment.