Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# a dead stupid profiler/debugger
# usage: ruby -r .../trace_func_profiler.rb my_program.rb
set_trace_func proc { |event, file, line, id, binding, classname|
unless ["line"].include? event
m = "#{classname}.#{id}"
t ="%H:%M:%S.%4N")
printf "%s|%8s %s:%-2d %s\n", t, event, file, line, m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.