A class that provides the functionality of Kernel#set_trace_func in a nice Object-Oriented API. Example¶ ↑ We can use TracePoint to gather information specifically for exceptions: trace = TracePoint.new(:raise) do |tp| p [tp.lineno, tp.event, tp.raised_exception] end #=> #<TracePoint:0x007f786a452448> trace.enable #=> #<TracePoint:0x007f786a452448> 0 / 0 #=> [5, :raise, #<ZeroDivisionError: divide