WIP: Allow for algorithm instantiation traceback logging
Example trace, taken from the HLT1 example options:
Algorithm instantiation: 'PrFilter__Track_v2/PrFilter__Track_v2#2'
Traceback (most recent call last):
/home/apearce/Analysis/Trigger/stack/Moore/Hlt/Hlt1Conf/options/hlt1_example.py in <module>()
29 for name, builder in builders.items():
---> 30 env.registerLine(name, builder())
31
/home/apearce/Analysis/Trigger/stack/Moore/Hlt/Hlt1Conf/python/Hlt1Conf/lines/track_mva.py in one_track_mva_line(make_input_tracks, make_pvs, max_chi2dof, min_pt, max_pt, min_ipchi2, param1, param2, param3)
53 track_filter = PrFilterV2Tracks(
---> 54 full_sel, Input=make_input_tracks()['v2Sel'])
55 return track_mva_prefilters() + [track_filter]
/home/apearce/Analysis/Trigger/stack/Moore/Hlt/Hlt1Conf/python/Hlt1Conf/algorithms.py in PrFilterV2Tracks(functor, **kwargs)
83 Factory='FunctorFactory',
---> 84 **kwargs)
85
or, in glorious technicolor
This shows the call stack for the first initialisation of the PrFilter__Track_v2/PrFilter__Track_v2#2
algorithm. (Subsequent 'instantiations' of identically-configured algorithms do not result in a traceback.)
The logging is piped through log.info
by default, and is triggered the EverythingHandler.print_algorithm_instantiations
method. This will print instantiation traces for all algorithms current known to the control flow (include their dependencies). Individual Algorithm tracebacks can be made with the Algorithm.print_instantiation_stack_trace
method.
Towards #58.
Edited by Alex Pearce