Class: Vedeu::API::Trace

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Trace

Returns a new instance of Trace.



44
45
46
# File 'lib/vedeu/api/log.rb', line 44

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

Class Method Details

.call(options = {}) ⇒ Object



40
41
42
# File 'lib/vedeu/api/log.rb', line 40

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

Instance Method Details

#traceObject



48
49
50
51
52
53
54
55
56
57
# File 'lib/vedeu/api/log.rb', line 48

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