| The Gaudi Framework v32r1 (f65d50dc)

Public Types | Public Member Functions | Private Attributes | List of all members
Auditor Class Reference

Base class from which all concrete auditor classes should be derived. More...

`#include <GaudiKernel/Auditor.h>`

Inheritance diagram for Auditor:
[legend]
Collaboration diagram for Auditor:
[legend]

## Public Types
using | Factory = Gaudi::PluginService::Factory< IAuditor *(const std::string &, ISvcLocator *)>
Public Types inherited from PropertyHolder< CommonMessaging< implements< IAuditor, IProperty > > >
using | PropertyHolderImpl = PropertyHolder< CommonMessaging< implements< IAuditor, IProperty > > >
| Typedef used to refer to this class from derived classes, as in. More...
Public Types inherited from CommonMessaging< implements< IAuditor, IProperty > >
using | base_class = CommonMessaging

## Public Member Functions
| Auditor (const std::string &name, ISvcLocator *svcloc)
| Constructor. More...
| Auditor (const Auditor &a)=delete
Auditor & | operator= (const Auditor &rhs)=delete
StatusCode | sysInitialize () override
| Initialization method invoked by the framework. More...
StatusCode | sysFinalize () override
| Finalization method invoked by the framework. More...
void | before (StandardEventType, INamedInterface *) override
| The following methods are meant to be implemented by the child class... More...
void | before (StandardEventType, const std::string &) override
void | before (CustomEventTypeRef, INamedInterface *) override
void | before (CustomEventTypeRef, const std::string &) override
void | after (StandardEventType, INamedInterface *, const StatusCode &) override
void | after (StandardEventType, const std::string &, const StatusCode &) override
void | after (CustomEventTypeRef, INamedInterface *, const StatusCode &) override
void | after (CustomEventTypeRef, const std::string &, const StatusCode &) override
void | beforeInitialize (INamedInterface *) override
void | afterInitialize (INamedInterface *) override
void | beforeReinitialize (INamedInterface *) override
void | afterReinitialize (INamedInterface *) override
void | beforeExecute (INamedInterface *) override
void | afterExecute (INamedInterface *, const StatusCode &) override
void | beforeFinalize (INamedInterface *) override
void | afterFinalize (INamedInterface *) override
void | beforeBeginRun (INamedInterface *) override
void | afterBeginRun (INamedInterface *) override
void | beforeEndRun (INamedInterface *) override
void | afterEndRun (INamedInterface *) override
virtual StatusCode | initialize ()
virtual StatusCode | finalize ()
const std::string & | name () const override
bool | isEnabled () const override
SmartIF< ISvcLocator > & | serviceLocator () const override
| The standard service locator. More...
template<class T >
StatusCode | service (const std::string &name, T *&svc, bool createIf=false) const
| Access a service by name, creating it if it doesn't already exist. More...
template<class T = IService>
SmartIF< T > | service (const std::string &name, bool createIf=false) const
StatusCode | setProperties ()
| Set the auditor's properties. More...
Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IAuditor, IProperty > > >
| PropertyHolder ()=default
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Details::PropertyBase &prop)
| Declare a property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
| Helper to wrap a regular data member and use it as a regular property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
| Declare a PropertyBase instance setting name and documentation. More...
Gaudi::Details::PropertyBase * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
| Declare a remote property. More...
StatusCode | setProperty (const Gaudi::Details::PropertyBase &p) override
| set the property form another property More...
StatusCode | setProperty (const std::string &s) override
| set the property from the formatted string More...
StatusCode | setProperty (const std::string &n, const std::string &v) override
| set the property from name and the value More...
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value More...
StatusCode | getProperty (Gaudi::Details::PropertyBase *p) const override
| get the property More...
const Gaudi::Details::PropertyBase & | getProperty (const std::string &name) const override
| get the property by name More...
StatusCode | getProperty (const std::string &n, std::string &v) const override
| convert the property to the string More...
const std::vector< Gaudi::Details::PropertyBase * > & | getProperties () const override
| get all properties More...
bool | hasProperty (const std::string &name) const override
| Return true if we have a property with the given name. More...
| PropertyHolder (const PropertyHolder &)=delete
PropertyHolder & | operator= (const PropertyHolder &)=delete
Public Member Functions inherited from CommonMessaging< implements< IAuditor, IProperty > >
MSG::Level | msgLevel () const
| get the cached level (originally extracted from the embedded MsgStream) More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...
MSG::Level | outputLevel () const
| Backward compatibility function for getting the output level. More...
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
const SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service. More...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO) More...

## Private Attributes
std::string | m_name
| Auditor's name for identification. More...
SmartIF< ISvcLocator > | m_pSvcLocator
| Pointer to service locator service. More...
Gaudi::Property< int > | m_outputLevel
Gaudi::Property< bool > | m_isEnabled {this, "Enable", true, "should the auditor be used or not"}
bool | m_isInitialized = false
| Auditor has been initialized flag. More...
bool | m_isFinalized = false
| Auditor has been finalized flag. More...

## Additional Inherited Members
Protected Member Functions inherited from PropertyHolder< CommonMessaging< implements< IAuditor, IProperty > > >
Gaudi::Details::PropertyBase * | property (const std::string &name) const
Protected Member Functions inherited from CommonMessaging< implements< IAuditor, IProperty > >
MSG::Level | setUpMessaging () const
| Set up local caches. More...
MSG::Level | resetMessaging ()
| Reinitialize internal states. More...
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. More...

## Detailed Description

Base class from which all concrete auditor classes should be derived.

The only base class functionality which may be used in the constructor of a concrete auditor is the declaration of member variables as properties. All other functionality, i.e. the use of services, may be used only in initialize() and afterwards.

Author
  David Quarrie

Date
  2000

Author
  Marco Clemencic

Date
  2008-03

Definition at line 34 of file Auditor.h.

## Member Typedef Documentation

## ◆ Factory

using Auditor::Factory = Gaudi::PluginService::Factory<IAuditor*( const std::string&, ISvcLocator* )>

Definition at line 36 of file Auditor.h.

## Constructor & Destructor Documentation

## ◆ Auditor() [1/2]

Auditor::Auditor | ( | const std::string & | name,
|  | ISvcLocator * | svcloc
| ) |  |

Constructor.

Parameters

  name | The algorithm object's name
  svcloc | A pointer to a service location service

Definition at line 12 of file Auditor.cpp.

12 : m_name( name ), m_pSvcLocator( pSvcLocator ) {}
Auditor::m_name
std::string m_name
Auditor's name for identification.
Definition: Auditor.h:129
Auditor::m_pSvcLocator
SmartIF< ISvcLocator > m_pSvcLocator
Pointer to service locator service.
Definition: Auditor.h:131
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:193

## ◆ Auditor() [2/2]

Auditor::Auditor | ( | const Auditor & | a | ) |
| delete

## Member Function Documentation

## ◆ after() [1/4]

void Auditor::after | ( | StandardEventType | evt,
|  | INamedInterface * | obj,
|  | const StatusCode & | sc
| ) |  |
| override

Definition at line 103 of file Auditor.cpp.

103 {
104 switch ( evt ) {
105 case Initialize:
106 afterInitialize( obj );
107 break;
108 case ReInitialize:
109 afterReinitialize( obj );
110 break;
111 case Execute:
112 afterExecute( obj, sc );
113 break;
114 case BeginRun:
115 afterBeginRun( obj );
116 break;
117 case EndRun:
118 afterEndRun( obj );
119 break;
120 case Finalize:
121 afterFinalize( obj );
122 break;
123 case Start:
124 break;
125 case Stop:
126 break;
127 case ReStart:
128 break;
129 default:
130 break; // do nothing
131 }
132 }
Auditor::afterEndRun
void afterEndRun(INamedInterface *) override
Definition: Auditor.cpp:147
Auditor::afterBeginRun
void afterBeginRun(INamedInterface *) override
Definition: Auditor.cpp:145
Auditor::afterExecute
void afterExecute(INamedInterface *, const StatusCode &) override
Definition: Auditor.cpp:143
Auditor::afterInitialize
void afterInitialize(INamedInterface *) override
Definition: Auditor.cpp:139
Auditor::afterFinalize
void afterFinalize(INamedInterface *) override
Definition: Auditor.cpp:149
IOTest.evt
evt
Definition: IOTest.py:94
Auditor::afterReinitialize
void afterReinitialize(INamedInterface *) override
Definition: Auditor.cpp:141

## ◆ after() [2/4]

void Auditor::after | ( | StandardEventType | ,
|  | const std::string & | ,
|  | const StatusCode & |
| ) |  |
| override

Definition at line 133 of file Auditor.cpp.

133 {}

## ◆ after() [3/4]

void Auditor::after | ( | CustomEventTypeRef | ,
|  | INamedInterface * | ,
|  | const StatusCode & |
| ) |  |
| override

Definition at line 135 of file Auditor.cpp.

135 {}

## ◆ after() [4/4]

void Auditor::after | ( | CustomEventTypeRef | ,
|  | const std::string & | ,
|  | const StatusCode & |
| ) |  |
| override

Definition at line 136 of file Auditor.cpp.

136 {}

## ◆ afterBeginRun()

void Auditor::afterBeginRun | ( | INamedInterface * |  | ) |
| override

Definition at line 145 of file Auditor.cpp.

145 {}

## ◆ afterEndRun()

void Auditor::afterEndRun | ( | INamedInterface * |  | ) |
| override

Definition at line 147 of file Auditor.cpp.

147 {}

## ◆ afterExecute()

void Auditor::afterExecute | ( | INamedInterface * | ,
|  | const StatusCode & |
| ) |  |
| override

Definition at line 143 of file Auditor.cpp.

143 {}

## ◆ afterFinalize()

void Auditor::afterFinalize | ( | INamedInterface * |  | ) |
| override

Definition at line 149 of file Auditor.cpp.

149 {}

## ◆ afterInitialize()

void Auditor::afterInitialize | ( | INamedInterface * |  | ) |
| override

Definition at line 139 of file Auditor.cpp.

139 {}

## ◆ afterReinitialize()

void Auditor::afterReinitialize | ( | INamedInterface * |  | ) |
| override

Definition at line 141 of file Auditor.cpp.

141 {}

## ◆ before() [1/4]

void Auditor::before | ( | StandardEventType | evt,
|  | INamedInterface * | obj
| ) |  |
| override

The following methods are meant to be implemented by the child class...

Definition at line 67 of file Auditor.cpp.

67 {
68 switch ( evt ) {
69 case Initialize:
70 beforeInitialize( obj );
71 break;
72 case ReInitialize:
73 beforeReinitialize( obj );
74 break;
75 case Execute:
76 beforeExecute( obj );
77 break;
78 case BeginRun:
79 beforeBeginRun( obj );
80 break;
81 case EndRun:
82 beforeEndRun( obj );
83 break;
84 case Finalize:
85 beforeFinalize( obj );
86 break;
87 case Start:
88 break;
89 case Stop:
90 break;
91 case ReStart:
92 break;
93 default:
94 break; // do nothing
95 }
96 }
Auditor::beforeInitialize
void beforeInitialize(INamedInterface *) override
Definition: Auditor.cpp:138
Auditor::beforeBeginRun
void beforeBeginRun(INamedInterface *) override
Definition: Auditor.cpp:144
Auditor::beforeExecute
void beforeExecute(INamedInterface *) override
Definition: Auditor.cpp:142
Auditor::beforeReinitialize
void beforeReinitialize(INamedInterface *) override
Definition: Auditor.cpp:140
Auditor::beforeFinalize
void beforeFinalize(INamedInterface *) override
Definition: Auditor.cpp:148
Auditor::beforeEndRun
void beforeEndRun(INamedInterface *) override
Definition: Auditor.cpp:146
IOTest.evt
evt
Definition: IOTest.py:94

## ◆ before() [2/4]

void Auditor::before | ( | StandardEventType | ,
|  | const std::string & |
| ) |  |
| override

Definition at line 97 of file Auditor.cpp.

97 {}

## ◆ before() [3/4]

void Auditor::before | ( | CustomEventTypeRef | ,
|  | INamedInterface * |
| ) |  |
| override

Definition at line 99 of file Auditor.cpp.

99 {}

## ◆ before() [4/4]

void Auditor::before | ( | CustomEventTypeRef | ,
|  | const std::string & |
| ) |  |
| override

Definition at line 100 of file Auditor.cpp.

100 {}

## ◆ beforeBeginRun()

void Auditor::beforeBeginRun | ( | INamedInterface * |  | ) |
| override

Definition at line 144 of file Auditor.cpp.

144 {}

## ◆ beforeEndRun()

void Auditor::beforeEndRun | ( | INamedInterface * |  | ) |
| override

Definition at line 146 of file Auditor.cpp.

146 {}

## ◆ beforeExecute()

void Auditor::beforeExecute | ( | INamedInterface * |  | ) |
| override

Definition at line 142 of file Auditor.cpp.

142 {}

## ◆ beforeFinalize()

void Auditor::beforeFinalize | ( | INamedInterface * |  | ) |
| override

Definition at line 148 of file Auditor.cpp.

148 {}

## ◆ beforeInitialize()

void Auditor::beforeInitialize | ( | INamedInterface * |  | ) |
| override

Definition at line 138 of file Auditor.cpp.

138 {}

## ◆ beforeReinitialize()

void Auditor::beforeReinitialize | ( | INamedInterface * |  | ) |
| override

Definition at line 140 of file Auditor.cpp.

140 {}

## ◆ finalize()

StatusCode Auditor::finalize | ( |  | ) |
| virtual

Reimplemented in PerfMonAuditor, Google::AuditorBase, TimingAuditor, and AlgContextAuditor.

Definition at line 191 of file Auditor.cpp.

191 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

## ◆ initialize()

StatusCode Auditor::initialize | ( |  | ) |
| virtual

Reimplemented in Google::HeapChecker, PerfMonAuditor, TimingAuditor, Google::AuditorBase, AlgContextAuditor, IntelProfilerAuditor, MemStatAuditor, and ChronoAuditor.

Definition at line 64 of file Auditor.cpp.

64 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

## ◆ isEnabled()

bool Auditor::isEnabled | ( |  | ) | const
| override

Definition at line 195 of file Auditor.cpp.

195 { return m_isEnabled; }
Auditor::m_isEnabled
Gaudi::Property< bool > m_isEnabled
Definition: Auditor.h:137

## ◆ name()

const std::string & Auditor::name | ( |  | ) | const
| override

Definition at line 193 of file Auditor.cpp.

193 { return m_name; }
Auditor::m_name
std::string m_name
Auditor's name for identification.
Definition: Auditor.h:129

## ◆ operator=()

Auditor& Auditor::operator= | ( | const Auditor & | rhs | ) |
| delete

## ◆ service() [1/2]

template<class T >

StatusCode Auditor::service | ( | const std::string & | name,
|  | T *& | svc,
|  | bool | createIf = `false`
| ) |  | const
| inline

Access a service by name, creating it if it doesn't already exist.

Definition at line 105 of file Auditor.h.

105 {
106 auto ptr = serviceLocator()->service<T>( name, createIf );
107 if ( ptr ) {
108 svc = ptr.get();
109 svc->addRef();
110 return StatusCode::SUCCESS;
111 }
112 svc = nullptr;
113 return StatusCode::FAILURE;
114 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
Auditor::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
The standard service locator.
Definition: Auditor.cpp:197
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:76
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:193
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86

## ◆ service() [2/2]

template<class T = IService>

SmartIF<T> Auditor::service | ( | const std::string & | name,
|  | bool | createIf = `false`
| ) |  | const
| inline

Definition at line 117 of file Auditor.h.

117 {
118 return serviceLocator()->service<T>( name, createIf );
119 }
Auditor::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
The standard service locator.
Definition: Auditor.cpp:197
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:76
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:193

## ◆ serviceLocator()

SmartIF< ISvcLocator > & Auditor::serviceLocator | ( |  | ) | const
| override

The standard service locator.

Returns a pointer to the service locator service. This service may be used by an auditor to request any services it requires in addition to those provided by default.

Definition at line 197 of file Auditor.cpp.

197 { return m_pSvcLocator; }
Auditor::m_pSvcLocator
SmartIF< ISvcLocator > m_pSvcLocator
Pointer to service locator service.
Definition: Auditor.h:131

## ◆ setProperties()

StatusCode Auditor::setProperties | ( |  | ) |

Set the auditor's properties.

This method requests the job options service to set the values of any declared properties. The method is invoked from within sysInitialize() by the framework and does not need to be explicitly called by a concrete auditor.

Definition at line 200 of file Auditor.cpp.

200 {
201 if ( !m_pSvcLocator ) return StatusCode::FAILURE;
202 auto jos = service<IJobOptionsSvc>( "JobOptionsSvc" );
203 if ( !jos ) return StatusCode::FAILURE;
204
205 // this initializes the messaging, in case property update handlers need to print
206 // and update the property value bypassing the update handler
207 m_outputLevel.value() = setUpMessaging();
208
209 return jos->setMyProperties( name(), this );
210 }
CommonMessaging< implements< IAuditor, IProperty > >::setUpMessaging
MSG::Level setUpMessaging() const
Set up local caches.
Definition: CommonMessaging.h:169
Auditor::m_pSvcLocator
SmartIF< ISvcLocator > m_pSvcLocator
Pointer to service locator service.
Definition: Auditor.h:131
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:193
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
Auditor::m_outputLevel
Gaudi::Property< int > m_outputLevel
Definition: Auditor.h:133

## ◆ sysFinalize()

StatusCode Auditor::sysFinalize | ( |  | ) |
| override

Finalization method invoked by the framework.

This method is responsible for any bookkeeping of initialization required by the framework itself.

RETURN !!!

catch GaudiExeption

(1) perform the printout of message

(2) print the exception itself (NB! - GaudiException is a linked list of all "previous exceptions")

catch std::exception

(1) perform the printout of message

(2) print the exception itself

catch unknown exception

(1) perform the printout

Definition at line 151 of file Auditor.cpp.

151 {
152 StatusCode sc = StatusCode::SUCCESS;
153 try {
154 //
155 // Invoke the finalize() method of the derived class if
156 // it has been initialized.
157 if ( m_isInitialized && !m_isFinalized ) {
158 m_isFinalized = true;
159 sc = finalize();
160 if ( !sc.isSuccess() ) return StatusCode::FAILURE;
161 }
162 return sc;
163 //
164 } catch ( const GaudiException& Exception )
165 {
167 MsgStream log( msgSvc(), name() + ".sysFinalize()" );
168 log << MSG::FATAL << " Exception with tag=" << Exception.tag() << " is catched " << endmsg;
171 MsgStream logEx( msgSvc(), Exception.tag() );
172 logEx << MSG::ERROR << Exception << endmsg;
173 } catch ( const std::exception& Exception )
174 {
176 MsgStream log( msgSvc(), name() + ".sysFinalize()" );
177 log << MSG::FATAL << " Standard std::exception is caught " << endmsg;
179 MsgStream logEx( msgSvc(), name() + "*std::exception*" );
180 logEx << MSG::ERROR << Exception.what() << endmsg;
181 } catch ( ... )
182 {
184 MsgStream log( msgSvc(), name() + ".sysFinalize()" );
185 log << MSG::FATAL << " UNKNOWN Exception is caught " << endmsg;
186 }
188 return StatusCode::FAILURE;
189 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Auditor::finalize
virtual StatusCode finalize()
Definition: Auditor.cpp:191
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:21
CommonMessagingBase::msgSvc
const SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: CommonMessaging.h:68
GaudiException::tag
virtual const std::string & tag() const
name tag for the exception, or exception type
Definition: GaudiException.h:67
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
MSG::FATAL
Definition: IMessageSvc.h:15
Auditor::m_isInitialized
bool m_isInitialized
Auditor has been initialized flag.
Definition: Auditor.h:139
std::exception::what
T what(T... args)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
std::exception
STL class.
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:193
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
MSG::ERROR
Definition: IMessageSvc.h:15
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
Gaudi.Configuration.log
log
Definition: Configuration.py:13
Auditor::m_isFinalized
bool m_isFinalized
Auditor has been finalized flag.
Definition: Auditor.h:140

## ◆ sysInitialize()

StatusCode Auditor::sysInitialize | ( |  | ) |
| override

Initialization method invoked by the framework.

This method is responsible for any bookkeeping of initialization required by the framework itself.

RETURN !!!

catch Gaudi Exception

(1) perform the printout of message

(2) print the exception itself (NB! - GaudiException is a linked list of all "previous exceptions")

catch std::exception

(1) perform the printout of message

(2) print the exception itself (NB! - GaudiException is a linked list of all "previous exceptions")

(1) perform the printout

Definition at line 15 of file Auditor.cpp.

15 {
16 StatusCode sc;
17
18 // Bypass the initialization if the auditor is disabled or
19 // has already been initialized.
20 if ( isEnabled() && !m_isInitialized ) {
21
22 // Setup the default service ... this should be upgraded so as to be configurable.
23 if ( !m_pSvcLocator ) return StatusCode::FAILURE;
24
25 // Set the Auditor's properties
26 sc = setProperties();
27 if ( !sc.isSuccess() ) return StatusCode::FAILURE;
28
29 {
30 try {
31 // Invoke the initialize() method of the derived class
32 sc = initialize();
33 if ( !sc.isSuccess() ) return StatusCode::FAILURE;
34 m_isInitialized = true;
35
36 return sc;
37 } catch ( const GaudiException& Exception )
38 {
40 MsgStream log( msgSvc(), name() + ".sysInitialize()" );
41 log << MSG::FATAL << " Exception with tag=" << Exception.tag() << " is caught " << endmsg;
43 MsgStream logEx( msgSvc(), Exception.tag() );
44 logEx << MSG::ERROR << Exception << endmsg;
45 } catch ( const std::exception& Exception )
46 {
48 MsgStream log( msgSvc(), name() + ".sysInitialize()" );
49 log << MSG::FATAL << " Standard std::exception is caught " << endmsg;
51 MsgStream logEx( msgSvc(), name() + "*std::exception*" );
52 logEx << MSG::ERROR << Exception.what() << endmsg;
53 } catch ( ... ) {
55 MsgStream log( msgSvc(), name() + ".sysInitialize()" );
56 log << MSG::FATAL << " UNKNOWN Exception is caught " << endmsg;
57 }
58 }
59 }
61 return StatusCode::FAILURE;
62 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:21
CommonMessagingBase::msgSvc
const SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: CommonMessaging.h:68
Auditor::setProperties
StatusCode setProperties()
Set the auditor's properties.
Definition: Auditor.cpp:200
GaudiException::tag
virtual const std::string & tag() const
name tag for the exception, or exception type
Definition: GaudiException.h:67
MSG::FATAL
Definition: IMessageSvc.h:15
Auditor::m_isInitialized
bool m_isInitialized
Auditor has been initialized flag.
Definition: Auditor.h:139
Auditor::m_pSvcLocator
SmartIF< ISvcLocator > m_pSvcLocator
Pointer to service locator service.
Definition: Auditor.h:131
std::exception::what
T what(T... args)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
std::exception
STL class.
Auditor::isEnabled
bool isEnabled() const override
Definition: Auditor.cpp:195
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:193
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
MSG::ERROR
Definition: IMessageSvc.h:15
Auditor::initialize
virtual StatusCode initialize()
Definition: Auditor.cpp:64
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
Gaudi.Configuration.log
log
Definition: Configuration.py:13

## Member Data Documentation

## ◆ m_isEnabled

Gaudi::Property<bool> Auditor::m_isEnabled {this, "Enable", true, "should the auditor be used or not"}
| private

Definition at line 137 of file Auditor.h.

## ◆ m_isFinalized

bool Auditor::m_isFinalized = false
| private

Auditor has been finalized flag.

Definition at line 140 of file Auditor.h.

## ◆ m_isInitialized

bool Auditor::m_isInitialized = false
| private

Auditor has been initialized flag.

Definition at line 139 of file Auditor.h.

## ◆ m_name

std::string Auditor::m_name
| private

Auditor's name for identification.

Definition at line 129 of file Auditor.h.

## ◆ m_outputLevel

Gaudi::Property<int> Auditor::m_outputLevel
| private

Initial value:
{
this, "OutputLevel", MSG::NIL,
[this]( Gaudi::Details::PropertyBase& ) { this->updateMsgStreamOutputLevel( this->m_outputLevel ); },
"output level"}

Definition at line 133 of file Auditor.h.

## ◆ m_pSvcLocator

SmartIF<ISvcLocator> Auditor::m_pSvcLocator
| mutable private

Pointer to service locator service.

Definition at line 131 of file Auditor.h.

The documentation for this class was generated from the following files:

- GaudiKernel/GaudiKernel/Auditor.h
- GaudiKernel/src/Lib/Auditor.cpp