Skip to content

Messages: Refine source field truncation

Walter Lampl requested to merge wlampl/Gaudi:msgTruncation into master

This MR addresses a longstanding annoyance, at least on the ATLAS side. With our deep stack of AlgTools the component name (with parents) is often longer than the source-field of the message. Since the source-name is truncated at the end we never see which component is actually emitting the message. This MR introduces a new format-specifier ('c') that cuts out the middle part of the source-name while giving priority to the last component in the stack. This way, a message like

InDetSCT_Clusterization.InDetSCT_ConditionsSumm... INFO Database will be used.

becomes

InDetSCT_Clusterization...InDetSCT_TdaqEnabledTool INFO Database will be used.

The abbreviation strategy is as follows:

  • If the field-width can accommodate the name of the last component, it will print it preceded by three dots and filling up the remaining width by printing the beginning of the input string
  • If the field-width can not even accommodate the last component-name or if no dot is found, it will cut out the middle-part, eg print the beginning of the input string, three dots and the end of the input string

Merge request reports