| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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
typedef Gaudi::PluginService::Factory< IAuditor *, const std::string &, ISvcLocator * > | Factory
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
| ~PropertyHolder () override=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, TYPE &value, const std::string &doc="none") const
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
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleBase &ref, const std::string &doc="none")
| Specializations for various GaudiHandles. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleArrayBase &ref, const std::string &doc="none")
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, DataObjectHandleBase &ref, const std::string &doc="none")
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...
MSG::Level | msgLevel () const
| get the cached level (originally extracted from the embedded MsgStream) More...
MSG::Level | outputLevel () const __attribute__((deprecated))
| Backward compatibility function for getting the output level. More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream 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 {this, "OutputLevel", MSG::NIL, "output level"}
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 ()
| 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 35 of file Auditor.h.

## Member Typedef Documentation

typedef Gaudi::PluginService::Factory<IAuditor*, const std::string&, ISvcLocator*> Auditor::Factory

Definition at line 39 of file Auditor.h.

## Constructor & Destructor Documentation

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.

13 : m_name( name ), m_pSvcLocator( pSvcLocator ), m_isInitialized( false ), m_isFinalized( false )
14 {
15 m_outputLevel.declareUpdateHandler(
16 [this]( Gaudi::Details::PropertyBase& ) { this->updateMsgStreamOutputLevel( this->m_outputLevel ); } );
17 }
Auditor::m_name
std::string m_name
Auditor&#39;s name for identification.
Definition: Auditor.h:135
Auditor::m_isInitialized
bool m_isInitialized
Auditor has been initialized flag.
Definition: Auditor.h:142
Auditor::m_pSvcLocator
SmartIF< ISvcLocator > m_pSvcLocator
Pointer to service locator service.
Definition: Auditor.h:137
CommonMessaging< implements< IAuditor, IProperty > >::updateMsgStreamOutputLevel
void updateMsgStreamOutputLevel(int level)
Update the output level of the cached MsgStream.
Definition: CommonMessaging.h:188
Gaudi::Details::PropertyBase
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
Auditor::m_outputLevel
Gaudi::Property< int > m_outputLevel
Definition: Auditor.h:139
Auditor::m_isFinalized
bool m_isFinalized
Auditor has been finalized flag.
Definition: Auditor.h:143

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

## Member Function Documentation

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

Definition at line 110 of file Auditor.cpp.

111 {
112 switch ( evt ) {
113 case Initialize:
114 afterInitialize( obj );
115 break;
116 case ReInitialize:
117 afterReinitialize( obj );
118 break;
119 case Execute:
120 afterExecute( obj, sc );
121 break;
122 case BeginRun:
123 afterBeginRun( obj );
124 break;
125 case EndRun:
126 afterEndRun( obj );
127 break;
128 case Finalize:
129 afterFinalize( obj );
130 break;
131 case Start:
132 break;
133 case Stop:
134 break;
135 case ReStart:
136 break;
137 default:
138 break; // do nothing
139 }
140 }
Auditor::afterEndRun
void afterEndRun(INamedInterface *) override
Definition: Auditor.cpp:155
Auditor::afterBeginRun
void afterBeginRun(INamedInterface *) override
Definition: Auditor.cpp:153
Auditor::afterExecute
void afterExecute(INamedInterface *, const StatusCode &) override
Definition: Auditor.cpp:151
Auditor::afterInitialize
void afterInitialize(INamedInterface *) override
Definition: Auditor.cpp:147
Auditor::afterFinalize
void afterFinalize(INamedInterface *) override
Definition: Auditor.cpp:157
IOTest.evt
evt
Definition: IOTest.py:96
Auditor::afterReinitialize
void afterReinitialize(INamedInterface *) override
Definition: Auditor.cpp:149

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

Definition at line 141 of file Auditor.cpp.

141 {}

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

Definition at line 143 of file Auditor.cpp.

143 {}

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

Definition at line 144 of file Auditor.cpp.

144 {}

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

Definition at line 153 of file Auditor.cpp.

153 {}

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

Definition at line 155 of file Auditor.cpp.

155 {}

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

Definition at line 151 of file Auditor.cpp.

151 {}

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

Definition at line 157 of file Auditor.cpp.

157 {}

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

Definition at line 147 of file Auditor.cpp.

147 {}

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

Definition at line 149 of file Auditor.cpp.

149 {}

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

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

Definition at line 73 of file Auditor.cpp.

74 {
75 switch ( evt ) {
76 case Initialize:
77 beforeInitialize( obj );
78 break;
79 case ReInitialize:
80 beforeReinitialize( obj );
81 break;
82 case Execute:
83 beforeExecute( obj );
84 break;
85 case BeginRun:
86 beforeBeginRun( obj );
87 break;
88 case EndRun:
89 beforeEndRun( obj );
90 break;
91 case Finalize:
92 beforeFinalize( obj );
93 break;
94 case Start:
95 break;
96 case Stop:
97 break;
98 case ReStart:
99 break;
100 default:
101 break; // do nothing
102 }
103 }
Auditor::beforeInitialize
void beforeInitialize(INamedInterface *) override
Definition: Auditor.cpp:146
Auditor::beforeBeginRun
void beforeBeginRun(INamedInterface *) override
Definition: Auditor.cpp:152
Auditor::beforeExecute
void beforeExecute(INamedInterface *) override
Definition: Auditor.cpp:150
Auditor::beforeReinitialize
void beforeReinitialize(INamedInterface *) override
Definition: Auditor.cpp:148
Auditor::beforeFinalize
void beforeFinalize(INamedInterface *) override
Definition: Auditor.cpp:156
Auditor::beforeEndRun
void beforeEndRun(INamedInterface *) override
Definition: Auditor.cpp:154
IOTest.evt
evt
Definition: IOTest.py:96

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

Definition at line 104 of file Auditor.cpp.

104 {}

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

Definition at line 106 of file Auditor.cpp.

106 {}

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

Definition at line 107 of file Auditor.cpp.

107 {}

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

Definition at line 152 of file Auditor.cpp.

152 {}

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

Definition at line 154 of file Auditor.cpp.

154 {}

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

Definition at line 150 of file Auditor.cpp.

150 {}

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

Definition at line 156 of file Auditor.cpp.

156 {}

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

Definition at line 146 of file Auditor.cpp.

146 {}

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

Definition at line 148 of file Auditor.cpp.

148 {}

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

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

Definition at line 200 of file Auditor.cpp.

200 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
Definition: StatusCode.h:29

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

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

Definition at line 70 of file Auditor.cpp.

70 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
Definition: StatusCode.h:29

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

Definition at line 204 of file Auditor.cpp.

204 { return m_isEnabled; }
Auditor::m_isEnabled
Gaudi::Property< bool > m_isEnabled
Definition: Auditor.h:140

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

Definition at line 202 of file Auditor.cpp.

202 { return m_name; }
Auditor::m_name
std::string m_name
Auditor&#39;s name for identification.
Definition: Auditor.h:135

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

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 109 of file Auditor.h.

110 {
111 auto ptr = serviceLocator()->service<T>( name, createIf );
112 if ( ptr ) {
113 svc = ptr.get();
114 svc->addRef();
115 return StatusCode::SUCCESS;
116 }
117 svc = nullptr;
118 return StatusCode::FAILURE;
119 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
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:79
Auditor::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
The standard service locator.
Definition: Auditor.cpp:206
StatusCode::FAILURE
Definition: StatusCode.h:29
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:202
template<class T = IService>

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

Definition at line 122 of file Auditor.h.

123 {
124 return serviceLocator()->service<T>( name, createIf );
125 }
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:79
Auditor::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
The standard service locator.
Definition: Auditor.cpp:206
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:202

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 206 of file Auditor.cpp.

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

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 209 of file Auditor.cpp.

210 {
211 if ( !m_pSvcLocator ) return StatusCode::FAILURE;
212 auto jos = service<IJobOptionsSvc>( "JobOptionsSvc" );
213 if ( !jos ) return StatusCode::FAILURE;
214
215 // this initializes the messaging, in case property update handlers need to print
216 // and update the property value bypassing the update handler
217 m_outputLevel.value() = setUpMessaging();
218
219 return jos->setMyProperties( name(), this );
220 }
Auditor::m_pSvcLocator
SmartIF< ISvcLocator > m_pSvcLocator
Pointer to service locator service.
Definition: Auditor.h:137
StatusCode::FAILURE
Definition: StatusCode.h:29
CommonMessaging< implements< IAuditor, IProperty > >::setUpMessaging
MSG::Level setUpMessaging()
Set up local caches.
Definition: CommonMessaging.h:166
Auditor::m_outputLevel
Gaudi::Property< int > m_outputLevel
Definition: Auditor.h:139
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:202

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 159 of file Auditor.cpp.

160 {
161 StatusCode sc = StatusCode::SUCCESS;
162 try {
163 //
164 // Invoke the finalize() method of the derived class if
165 // it has been initialized.
166 if ( m_isInitialized && !m_isFinalized ) {
167 m_isFinalized = true;
168 sc = finalize();
169 if ( !sc.isSuccess() ) return StatusCode::FAILURE;
170 }
171 return sc;
172 //
173 } catch ( const GaudiException& Exception )
174 {
176 MsgStream log( msgSvc(), name() + ".sysFinalize()" );
177 log << MSG::FATAL << " Exception with tag=" << Exception.tag() << " is catched " << endmsg;
180 MsgStream logEx( msgSvc(), Exception.tag() );
181 logEx << MSG::ERROR << Exception << endmsg;
182 } catch ( const std::exception& Exception )
183 {
185 MsgStream log( msgSvc(), name() + ".sysFinalize()" );
186 log << MSG::FATAL << " Standard std::exception is caught " << endmsg;
188 MsgStream logEx( msgSvc(), name() + "*std::exception*" );
189 logEx << MSG::ERROR << Exception.what() << endmsg;
190 } catch ( ... )
191 {
193 MsgStream log( msgSvc(), name() + ".sysFinalize()" );
194 log << MSG::FATAL << " UNKNOWN Exception is caught " << endmsg;
195 }
197 return StatusCode::FAILURE;
198 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Auditor::finalize
virtual StatusCode finalize()
Definition: Auditor.cpp:200
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:22
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:50
MSG::FATAL
Definition: IMessageSvc.h:16
Auditor::m_isInitialized
bool m_isInitialized
Auditor has been initialized flag.
Definition: Auditor.h:142
std::exception::what
T what(T...args)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
GaudiException::tag
virtual const std::string & tag() const
name tag for the exception, or exception type
Definition: GaudiException.h:109
CommonMessagingBase::msgSvc
const SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: CommonMessaging.h:75
std::exception
STL class.
MSG::ERROR
Definition: IMessageSvc.h:16
StatusCode::FAILURE
Definition: StatusCode.h:29
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:202
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Gaudi.Configuration.log
log
Definition: Configuration.py:13
Auditor::m_isFinalized
bool m_isFinalized
Auditor has been finalized flag.
Definition: Auditor.h:143

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 20 of file Auditor.cpp.

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

## Member Data Documentation

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

Definition at line 140 of file Auditor.h.

bool Auditor::m_isFinalized = false
| private

Auditor has been finalized flag.

Definition at line 143 of file Auditor.h.

bool Auditor::m_isInitialized = false
| private

Auditor has been initialized flag.

Definition at line 142 of file Auditor.h.

std::string Auditor::m_name
| private

Auditor's name for identification.

Definition at line 135 of file Auditor.h.

Gaudi::Property<int> Auditor::m_outputLevel {this, "OutputLevel", MSG::NIL, "output level"}
| private

Definition at line 139 of file Auditor.h.

SmartIF<ISvcLocator> Auditor::m_pSvcLocator
| mutable private

Pointer to service locator service.

Definition at line 137 of file Auditor.h.

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

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