Class: Vedeu::Instrumentation::Trace

Inherits:
Object
  • Object
show all
Defined in:
lib/vedeu/instrumentation.rb

Overview

def filename

  Vedeu.root_path + '/tmp/' + @filename
end

end

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Trace

Returns a new instance of Trace.



67
68
69
# File 'lib/vedeu/instrumentation.rb', line 67

def initialize(options = {})
  @options = options
end

Class Method Details

.call(options = {}) ⇒ Object



63
64
65
# File 'lib/vedeu/instrumentation.rb', line 63

def self.call(options = {})
  new(options).trace
end

Instance Method Details

#traceObject



71
72
73
74
75
76
77
78
79
80
# File 'lib/vedeu/instrumentation.rb', line 71

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))
      # binding.eval('local_variables').each do |var|
      #   print("#{var.to_s} = #{binding.local_variable_get(var).inspect}\n")
      # end
    end
  }
end