'Signal handler to log the stack trace of the current thread.
For use with `set_blocking_signal_threshold`.'

def log_stack(self, signal, frame):

    gen_log.warning('IOLoop    blocked    for    %f    seconds    in\n%s', self._blocking_signal_threshold, ''.join(traceback.format_stack(frame)))
