Can you change this to as it was before, the sorttype_tsub + limit 50?
For a reference look at http://code.google.com/p/yappi/wiki/apiyappi

+ can you remove the logger and simply write to stderr?