It should not be a class method. Better would be re-using a Trace instance multiple times and using set_handler for this instance.