Use MessageSvc to handle ROOT messages
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:
- it works only if ROOT (
gROOT
) has been initialized beforeApplicationMgr::configure
, but my tests suggest this is always the case - every message sent by ROOT makes a call to
IMessageSvc::outputLevel( source )
to decide if the message has to be printed or not, whileMsgStream
instances cache the thresholds; we can optimize the adapter caching internally the thresholds (e.g. with astatic std::unordered_map<std::string, int> thresholds
) or by using a global threshold for ROOT messages.