Skip to content

provide setPackageMsgLevel and printAllPackageMsgLevels functions

Nils Erik Krumnack requested to merge krumnack/athena:pkg_message_level into 21.2

In some places we use package-level messaging, so that even outside of dual-use tools/algorithms we can use ATLAS messaging. While this is of course better than nothing, so far it does miss out on one of the core features of ATLAS messaging: Being able to change the message level from the python configuration without touching any code. This update tries to provide a mechanism for that.

It provides two functions to that end: asg::setPackageMsgLevel sets the message level for a given package by name, and asg::printAllPackageMsgLevels prints out all package message levels referenced so far. For use from python this is ROOT.asg.* instead.

There are several limitations here:

  • Package message streams aren't defined until referenced, so users just have to know the name and if they get it wrong they will never know. Being able to print out all package-level message streams at the end of their job should make it easier for users to debug this though.

  • You may have to do some python magic to make sure that the dictionary containing those functions is actually available in your python configuration. This is the usual problem with accessing non-class entries from dictionaries and if anybody knows a solution that should be easy to fix.

  • When running in EventLoop these message levels will (currently) not be propagated to the worker nodes for batch/grid-running. This could/should be addressed with a separate update.

Merge request reports