lib/rack/insight/instrumentation/probe.rb in rack-insight-0.5.5 vs lib/rack/insight/instrumentation/probe.rb in rack-insight-0.5.6
- old
+ new
@@ -126,11 +126,13 @@
end
end
include Logging
def log &block
- logger.debug &block
+ if verbose(:debug)
+ logger.debug &block
+ end
end
def fulfill_probe_orders
log{{:probes_for => @const.name, :type => self.class}}
@probe_orders.each do |method_name|
@@ -181,12 +183,12 @@
end
def define_trace_method(target, method)
(class << target; self; end).class_exec() do
define_method(method.name) do |*args, &block|
- ProbeRunner::probe_run(self, target.name, :class, args, caller(0)[0], method.name) do
- method.bind(self).call(*args, &block)
- end
+ ProbeRunner::probe_run(self, target.name, :class, args, caller(0)[0], method.name) do
+ method.bind(self).call(*args, &block)
+ end
end
end
end
end