6#include "GaudiKernel/Bootstrap.h"
7#include "GaudiKernel/IMessageSvc.h"
8#include "GaudiKernel/ISvcLocator.h"
9#include "GaudiKernel/ServiceHandle.h"
29 IMessageSvc* svc =
nullptr;
39 msgSvc.retrieve().isFailure()) && warn ) {
40 std::cerr <<
"Athena::getMessageSvc: WARNING MessageSvc not found, will use std::cout" << std::endl;
44 catch (
const GaudiException& e)
46 std::cerr <<
"Athena::getMessageSvc: WARNING Got Gaudi exception " << e
47 <<
"; will use std::out" << std::endl;
57 if (ims) ims->reportMessage(source,
type, message);
61 if (ims)
return ims->outputLevel(source);
62 else return MSG::INFO;
66 if(ims) ims->setOutputLevel(source, level);
Define macros for attributes used to control the static checker.
#define ATLAS_THREAD_SAFE
get a IMessageSvc* on 1st use (if not set) and release it on ~
~IMessageSvcHolder()
releases the IMessageSvc
IMessageSvcHolder()
will take the IMessageSvc* lazily from getMessageSvc() in get() Slow, but useful for classes without ...
IMessageSvcHolder & operator=(const IMessageSvcHolder &)
IMessageSvc * get()
upon first access sets m_ims as needed
singleton-like access to IMessageSvc via open function and helper
Some weak symbol referencing magic... These are declared in AthenaKernel/getMessageSvc....
IMessageSvc * getMessageSvc(bool quiet=false)
int outputLevel(const IMessageSvc *ims, const std::string &source)
void reportMessage(IMessageSvc *ims, const std::string &source, int type, const std::string &message)
Wrappers for some of the IMessageSvc methods These can be used from libraries without explicit Gaudi ...
std::atomic< bool > getMessageSvcQuiet
Set this to force off the warning messages from getMessageSvc (in unit tests, for example).
void setOutputLevel(IMessageSvc *ims, const std::string &source, int level)