Refactor a bit dependencies logging
Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
parent
9a776c2978
commit
c91605b15b
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user