lib/vedeu/support/trace.rb in vedeu-0.1.18 vs lib/vedeu/support/trace.rb in vedeu-0.1.19

- old
+ new

@@ -1,6 +1,13 @@ module Vedeu + + # This class currently provides the means to trace each method call which + # occurs inside Vedeu. This is very useful (to me!) for debugging. Running + # this will make your application less responsive, and the tests + # excruciatingly slow to run. + # + # @api private class Trace # :nocov: # @param options [Hash] # @return [] @@ -16,28 +23,28 @@ # @return [] def trace set_trace_func proc { |event, file, line, id, binding, classname| if event == watched && classname.to_s.match(klass) - Vedeu.log(sprintf(" %s %-35s #%s", event, classname, id)) + Vedeu.log(sprintf(" %s %-35s #%s", event, classname, id), true) # binding.eval('local_variables').each do |var| # print("#{var.to_s} = #{binding.local_variable_get(var).inspect}\n") # end end } end private # @api private - # @return [] + # @return [String] def watched options[:event] end # @api private - # @return [] + # @return [Regexp] def klass options[:klass] end # @api private @@ -49,10 +56,10 @@ # @api private # @return [Hash] def defaults { event: 'call', - klass: /^Vedeu::(?!.*Log|Interface|Line|Stream|Style|Colour|Geometry|Terminal|Esc|ColourTranslator).*/ + klass: /^Vedeu::.*/ } end # everything except Interface, Geometry and Terminal # klass: /^Vedeu::(?!.*Interface|Geometry|Terminal).*/