#NEWLINE# def enable_tracing( self ) : #NEWLINE# #INDENT# ' enable tracing of hook calls and return an undo function. ' #NEWLINE# hooktrace = self . hook . _trace #NEWLINE# def before( hook_name , methods , kwargs ) : #NEWLINE# #INDENT# hooktrace . root . indent += 1 #NEWLINE# hooktrace ( hook_name , kwargs ) #NEWLINE# #UNINDENT# def after( outcome , hook_name , methods , kwargs ) : #NEWLINE# #INDENT# if ( outcome . excinfo is None ) : #NEWLINE# #INDENT# hooktrace ( 'finish' , hook_name , '-->' , outcome . result ) #NEWLINE# #UNINDENT# hooktrace . root . indent -= 1 #NEWLINE# #UNINDENT# return self . add_hookcall_monitoring ( before , after )