Use MessageSvc to handle ROOT messages
- Jan 24, 2023
-
-
Marco Clemencic authored
-
- Jan 23, 2023
-
-
Marco Clemencic authored
-
Marco Clemencic authored22723973
-
- Jan 20, 2023
-
-
Marco Clemencic authored
-
Marco Clemencic authored
-
The default ROOT error handler (the equivalent of Gaudi MessageSvc) prints messages to stderr, which is problematic with Gaudi based workflows that expect all messages to go through stdout and be filtered according to MessageSvc output level.
This MR replaces the ROOT error handler with an adapter function that redirects to MessageSvc.
There are a couple of drawbacks which the changes proposed here:
gROOT
) has been initialized before ApplicationMgr::configure
, but my tests suggest this is always the caseIMessageSvc::outputLevel( source )
to decide if the message has to be printed or not, while MsgStream
instances cache the thresholds; we can optimize the adapter caching internally the thresholds (e.g. with a static std::unordered_map<std::string, int> thresholds
) or by using a global threshold for ROOT messages.