1 #include "GaudiKernel/Kernel.h"
2 #include "GaudiKernel/ISvcLocator.h"
3 #include "GaudiKernel/IMessageSvc.h"
4 #include "GaudiKernel/IJobOptionsSvc.h"
6 #include "GaudiKernel/Auditor.h"
8 #include "GaudiKernel/MsgStream.h"
9 #include "GaudiKernel/GaudiException.h"
14 m_pSvcLocator(pSvcLocator),
17 m_isInitialized(
false),
22 declareProperty(
"OutputLevel", m_outputLevel =
MSG::NIL);
23 declareProperty(
"Enable", m_isEnabled =
true);
70 catch(
const std::exception& Exception )
178 <<
" Exception with tag=" << Exception.
tag() <<
" is catched " <<
endmsg;
185 catch(
const std::exception& Exception )
190 <<
" Standard std::exception is caught " <<
endmsg;
194 << Exception.what() <<
endmsg;
201 <<
" UNKNOWN Exception is caught " <<
endmsg;
235 auto jos = service<IJobOptionsSvc>(
"JobOptionsSvc");
237 jos->setMyProperties(
name(),
this ).
ignore();
StatusCode sysInitialize() override
Initialization method invoked by the framework.
Definition of the MsgStream class used to transmit messages.
bool m_isEnabled
Auditor is enabled flag.
virtual StatusCode finalize()
void setOutputLevel(int level)
Set the output level for current auditor.
bool hasProperty(const std::string &name) const override
Implementation of IProperty::hasProperty.
Define general base for Gaudi exception.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
void beforeInitialize(INamedInterface *) override
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
StatusCode getProperty(Property *p) const override
Get the value of a property.
StatusCode setProperty(const Property &p) override
set the property form another property
bool isSuccess() const
Test for a status code of SUCCESS.
StatusCode setProperties()
Set the auditor's properties.
void beforeBeginRun(INamedInterface *) override
SmartIF< IMessageSvc > m_MS
Message service.
StatusCode sysFinalize() override
Finalization method invoked by the framework.
void afterEndRun(INamedInterface *) override
Property manager helper class.
std::string m_name
Auditor's name for identification.
StatusCode getProperty(Property *p) const override
get the property
void afterBeginRun(INamedInterface *) override
bool m_isInitialized
Auditor has been initialized flag.
void beforeExecute(INamedInterface *) override
Auditor(const std::string &name, ISvcLocator *svcloc)
Constructor.
SmartIF< PropertyMgr > m_PropertyMgr
For management of properties.
void afterExecute(INamedInterface *, const StatusCode &) override
This class is used for returning status codes from appropriate routines.
void beforeReinitialize(INamedInterface *) override
const std::vector< Property * > & getProperties() const override
get all properties
void after(StandardEventType, INamedInterface *, const StatusCode &) override
virtual const std::string & tag() const
name tag for the exception, or exception type
const std::vector< Property * > & getProperties() const override
Get all properties.
SmartIF< ISvcLocator > & serviceLocator() const
The standard service locator.
void afterInitialize(INamedInterface *) override
StatusCode setProperty(const Property &p) override
Set a value of a property of an auditor.
IInterface compliant class extending IInterface with the name() method.
Property base class allowing Property* collections to be "homogeneous".
bool isEnabled() const override
const std::string & name() const override
bool hasProperty(const std::string &name) const override
Return true if we have a property with the given name.
void afterFinalize(INamedInterface *) override
void beforeFinalize(INamedInterface *) override
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
virtual StatusCode initialize()
void before(StandardEventType, INamedInterface *) override
The following methods are meant to be implemented by the child class...
void beforeEndRun(INamedInterface *) override
virtual void setOutputLevel(int new_level)=0
Set new global output level threshold.
int m_outputLevel
Auditor output level.
void afterReinitialize(INamedInterface *) override
SmartIF< ISvcLocator > m_pSvcLocator
Pointer to service locator service.
bool m_isFinalized
Auditor has been finalized flag.