3 from AthenaCommon.Logging
import logging, log
6 """Custom formatter for loggers within TriggerMenuMT package.
8 Logger names of type 'TriggerMenuMT.M1.M2.M3' will be shortened to
9 'TriggerMenuMT:M3' to avoid long logger names. Since the logging module
10 automatically applies log formats of parents to children this applies to
11 all loggers that are created via `logging.getLogger(__name__)` within
12 the TriggerMenuMT package.
15 fields = record.name.split(
'.')
17 record.name =
':'.
join([fields[0], fields[-1]])
18 return super().
format(record)
22 """Configure TriggerMenuMT logger"""
25 athena_hdlr = log.handlers[0]
26 hdlr = copy.copy(athena_hdlr)
29 logger.propagate =
False
30 logger.addHandler(hdlr)
34 _log = logging.getLogger(__name__)
36 _log.debug(
"Configuring TriggerMenuMT logger")