module Delfos::MethodLogging
Public Instance Methods
exclude?(method)
click to toggle source
# File lib/delfos/method_logging.rb, line 21 def exclude?(method) file, = method.source_location return true unless file exclude_file?(File.expand_path(file)) end
exclude_file?(file)
click to toggle source
# File lib/delfos/method_logging.rb, line 32 def exclude_file?(file) with_cache(file) do !FileSystem::CommonPath.included_in?(File.expand_path(file), Delfos.application_directories) end end
include_file?(file)
click to toggle source
# File lib/delfos/method_logging.rb, line 28 def include_file?(file) !exclude_file?(file) end
log(call_site, called_object, called_method, class_method, parameters)
click to toggle source
# File lib/delfos/method_logging.rb, line 15 def log(call_site, called_object, called_method, class_method, parameters) called_code = CodeLocation.from_called(called_object, called_method, class_method) Delfos.call_site_logger.log(parameters, call_site, called_code) end
reset!()
click to toggle source
# File lib/delfos/method_logging.rb, line 38 def reset! @cache = nil end
save_call_stack(call_sites, execution_number)
click to toggle source
# File lib/delfos/method_logging.rb, line 11 def save_call_stack(call_sites, execution_number) Delfos.call_site_logger.save_call_stack(call_sites, execution_number) end
Private Instance Methods
cache()
click to toggle source
# File lib/delfos/method_logging.rb, line 48 def cache @cache ||= {} end
with_cache(key) { || ... }
click to toggle source
# File lib/delfos/method_logging.rb, line 44 def with_cache(key) cache.include?(key) ? cache[key] : cache[key] = yield end