![]() |
The Gaudi Framework
v25r3
|
#include <src/MessageSvc/MessageSvc.h>
Classes | |
struct | MsgAry |
Private helper class to keep the count of messages of a type (MSG::LEVEL). More... | |
Public Types | |
typedef std::pair< std::string, std::ostream * > | NamedStream |
typedef std::multimap< int, NamedStream > | StreamMap |
typedef std::multimap < StatusCode, Message > | MessageMap |
typedef std::map< std::string, int > | ThresholdMap |
![]() | |
typedef extends2 | base_class |
Typedef to this class. More... | |
typedef extend_interfaces2 < IMessageSvc, IInactiveMessageCounter > | extend_interfaces_base |
Typedef to the base of this class. More... | |
typedef extend_interfaces_base::ext_iids | interfaces |
MPL set of all the implemented interfaces. More... | |
![]() | |
typedef Gaudi::PluginService::Factory2 < IService *, const std::string &, ISvcLocator * > | Factory |
![]() | |
typedef CommonMessaging | base_class |
![]() | |
typedef implements3 | base_class |
Typedef to this class. More... | |
typedef extend_interfaces3 < IService, IProperty, IStateful > | extend_interfaces_base |
Typedef to the base of this class. More... | |
typedef extend_interfaces_base::ext_iids | interfaces |
MPL set of all the implemented interfaces. More... | |
![]() | |
typedef mpl::fold< typename IService::iid::iids::type, typename mpl::fold< typename IProperty::iid::iids::type, typename IStateful::iid::iids::type, mpl::insert< mpl::_1, mpl::_2 > >::type, mpl::insert< mpl::_1, mpl::_2 > >::type | ext_iids |
MPL set of interfaces extended by this one. More... | |
![]() | |
enum | Status { SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR } |
Return status. More... | |
typedef Gaudi::InterfaceId < IInterface, 0, 0 > | iid |
Interface ID. More... | |
typedef mpl::set1< iid > | ext_iids |
Extra interfaces. More... | |
![]() | |
typedef mpl::fold< typename IMessageSvc::iid::iids::type, typename IInactiveMessageCounter::iid::iids::type, mpl::insert< mpl::_1, mpl::_2 > >::type | ext_iids |
MPL set of interfaces extended by this one. More... | |
Public Member Functions | |
MessageSvc (const std::string &name, ISvcLocator *svcloc) | |
virtual | ~MessageSvc () |
virtual StatusCode | reinitialize () |
Reinitialize Service. More... | |
virtual StatusCode | initialize () |
Initialize Service. More... | |
virtual StatusCode | finalize () |
Finalize Service. More... | |
virtual void | reportMessage (const Message &message) |
Report a message by sending a Message object to the message service. More... | |
virtual void | reportMessage (const Message &msg, int outputLevel) |
Report a message by sending a Message object to the message service. More... | |
virtual void | reportMessage (const StatusCode &code, const std::string &source="") |
Report an error to the message service. More... | |
virtual void | reportMessage (const char *source, int type, const char *message) |
Report a message by specifying the source, severity level and text. More... | |
virtual void | reportMessage (const std::string &source, int type, const std::string &message) |
Report a message by specifying the source, severity level and text. More... | |
virtual void | insertMessage (const StatusCode &code, const Message &message) |
Insert a message to be sent for a given status code into the error code repository. More... | |
virtual void | eraseMessage () |
Erase all messages associated to all status codes. More... | |
virtual void | eraseMessage (const StatusCode &code) |
Erase message associated to a given status code. More... | |
virtual void | eraseMessage (const StatusCode &code, const Message &message) |
Erase a given message associated to a given status code. More... | |
virtual void | insertStream (int message_type, const std::string &name, std::ostream *stream) |
Add a new stream for a message type (severity level). More... | |
virtual void | eraseStream () |
Delete all the streams. More... | |
virtual void | eraseStream (int message_type) |
Delete all the streams for a given message type (severity level). More... | |
virtual void | eraseStream (int message_type, std::ostream *stream) |
Delete a single stream for a given message type (severity level) More... | |
virtual void | eraseStream (std::ostream *stream) |
Delete all occurrences of a stream. More... | |
virtual std::ostream * | defaultStream () const |
Get the default stream. More... | |
virtual void | setDefaultStream (std::ostream *stream) |
Set the default stream. More... | |
virtual int | outputLevel () const |
Retrieve the current output level threshold. More... | |
virtual int | outputLevel (const std::string &source) const |
Retrieve the current output level threshold for a given message source. More... | |
virtual void | setOutputLevel (int new_level) |
Set new global output level threshold. More... | |
virtual void | setOutputLevel (const std::string &source, int new_level) |
Set new output level threshold for a given message source. More... | |
virtual bool | useColor () const |
Show whether colors are used. More... | |
virtual std::string | getLogColor (int logLevel) const |
Get the color codes for various log levels. More... | |
virtual int | messageCount (MSG::Level logLevel) const |
Get the number of messages issued at a particular level. More... | |
virtual void | incrInactiveCount (MSG::Level level, const std::string &src) |
Increment deactivated message count. More... | |
![]() | |
extends2 (A1 a1, A2 a2, A3 a3) | |
Templated constructor with 3 arguments. More... | |
extends2 (A1 a1, A2 a2) | |
Templated constructor with 2 arguments. More... | |
extends2 (A1 a1) | |
Templated constructor with 1 argument. More... | |
extends2 () | |
Default constructor. More... | |
virtual void * | i_cast (const InterfaceID &tid) const |
Implementation of IInterface::i_cast. More... | |
virtual StatusCode | queryInterface (const InterfaceID &ti, void **pp) |
Implementation of IInterface::queryInterface. More... | |
virtual std::vector< std::string > | getInterfaceNames () const |
Implementation of IInterface::getInterfaceNames. More... | |
virtual | ~extends2 () |
Virtual destructor. More... | |
![]() | |
virtual unsigned long | release () |
Release Interface instance. More... | |
virtual const std::string & | name () const |
Retrieve name of the service. More... | |
virtual StatusCode | configure () |
Configuration (from OFFLINE to CONFIGURED). More... | |
virtual StatusCode | start () |
Start (from INITIALIZED to RUNNING). More... | |
virtual StatusCode | stop () |
Stop (from RUNNING to INITIALIZED). More... | |
virtual StatusCode | terminate () |
Initialization (from CONFIGURED to OFFLINE). More... | |
virtual Gaudi::StateMachine::State | FSMState () const |
Get the current state. More... | |
virtual Gaudi::StateMachine::State | targetFSMState () const |
When we are in the middle of a transition, get the state where the transition is leading us. More... | |
virtual StatusCode | restart () |
Initialization (from RUNNING to RUNNING, via INITIALIZED). More... | |
virtual StatusCode | sysInitialize () |
Initialize Service. More... | |
virtual StatusCode | sysStart () |
Initialize Service. More... | |
virtual StatusCode | sysStop () |
Initialize Service. More... | |
virtual StatusCode | sysFinalize () |
Finalize Service. More... | |
virtual StatusCode | sysReinitialize () |
Re-initialize the Service. More... | |
virtual StatusCode | sysRestart () |
Re-initialize the Service. More... | |
virtual StatusCode | setProperty (const Property &p) |
Set the property by property. More... | |
virtual StatusCode | setProperty (const std::string &s) |
Set the property by string. More... | |
virtual StatusCode | setProperty (const std::string &n, const std::string &v) |
Set the property by std::string. More... | |
virtual StatusCode | getProperty (Property *p) const |
Get the property by property. More... | |
virtual const Property & | getProperty (const std::string &name) const |
Get the property by name. More... | |
virtual StatusCode | getProperty (const std::string &n, std::string &v) const |
Get the property by std::string. More... | |
virtual const std::vector < Property * > & | getProperties () const |
Get list of properties. More... | |
template<class TYPE > | |
StatusCode | setProperty (const std::string &name, const TYPE &value) |
set the property form the value More... | |
Service (const std::string &name, ISvcLocator *svcloc) | |
Standard Constructor. More... | |
SmartIF< ISvcLocator > & | serviceLocator () const |
Retrieve pointer to service locator. More... | |
StatusCode | setProperties () |
Method for setting declared properties to the values specified for the job. More... | |
template<class T > | |
StatusCode | service (const std::string &name, const T *&psvc, bool createIf=true) const |
Access a service by name, creating it if it doesn't already exist. More... | |
template<class T > | |
StatusCode | service (const std::string &name, T *&psvc, bool createIf=true) const |
template<class T > | |
StatusCode | service (const std::string &svcType, const std::string &svcName, T *&psvc) const |
Access a service by name and type, creating it if it doesn't already exist. More... | |
template<class T > | |
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const |
Declare the named property. More... | |
Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const |
Declare remote named properties. More... | |
SmartIF< IAuditorSvc > & | auditorSvc () const |
The standard auditor service.May not be invoked before sysInitialize() has been invoked. More... | |
![]() | |
CommonMessaging (const A1 &a1, const A2 &a2, const A3 &a3) | |
Templated constructor with 3 arguments. More... | |
CommonMessaging (const A1 &a1, const A2 &a2) | |
Templated constructor with 2 arguments. More... | |
CommonMessaging (const A1 &a1) | |
Templated constructor with 1 argument. More... | |
CommonMessaging () | |
Default constructor. More... | |
virtual | ~CommonMessaging () |
Virtual destructor. More... | |
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 output level from the embedded MsgStream More... | |
bool | msgLevel (MSG::Level lvl) const |
get the output level from the embedded MsgStream More... | |
![]() | |
virtual | ~extend_interfaces3 () |
Virtual destructor. More... | |
![]() | |
DeclareInterfaceID (IService, 3, 0) | |
InterfaceID. More... | |
virtual | ~IService () |
virtual destructor More... | |
![]() | |
DeclareInterfaceID (INamedInterface, 1, 0) | |
InterfaceID. More... | |
virtual | ~INamedInterface () |
Virtual destructor (always needed for abstract classes). More... | |
![]() | |
virtual unsigned long | addRef ()=0 |
Increment the reference count of Interface instance. More... | |
virtual unsigned long | refCount () const =0 |
Current reference count. More... | |
virtual | ~IInterface () |
Virtual destructor. More... | |
![]() | |
DeclareInterfaceID (IProperty, 2, 0) | |
InterfaceID. More... | |
![]() | |
DeclareInterfaceID (IStateful, 1, 0) | |
InterfaceID. More... | |
virtual | ~IStateful () |
![]() | |
virtual | ~extend_interfaces2 () |
Virtual destructor. More... | |
Private Types | |
typedef std::map< std::string, MSG::Color > | ColorMap |
typedef std::map< std::string, std::ostream * > | LoggedStreamsMap_t |
Private Member Functions | |
std::string | colTrans (std::string, int) |
void | initColors (Property &prop) |
void | setupColors (Property &prop) |
void | setupLimits (Property &prop) |
void | setupThreshold (Property &prop) |
void | setupInactCount (Property &prop) |
void | setupLogStreams () |
void | tee (const std::string &sourceName, const std::string &logFileName, const std::set< std::string > &declaredOutFileNames) |
Additional Inherited Members | |
![]() | |
static const InterfaceID & | interfaceID () |
Return an instance of InterfaceID identifying the interface. More... | |
![]() | |
virtual | ~Service () |
Standard Destructor. More... | |
int | outputLevel () const |
get the Service's output level More... | |
![]() | |
void | updateMsgStreamOutputLevel (int level) |
Update the output level of the cached MsgStream. More... | |
![]() | |
IntegerProperty | m_outputLevel |
Service output level. More... | |
Gaudi::StateMachine::State | m_state |
Service state. More... | |
Gaudi::StateMachine::State | m_targetState |
Service state. More... | |
![]() | |
SmartIF< IMessageSvc > | m_msgsvc |
Pointer to the message service;. More... | |
std::auto_ptr< MsgStream > | m_msgStream |
The predefined message stream. More... | |
bool | m_streamWithService |
Flag to create a new MsgStream if it was created without the message service. More... | |
Definition at line 31 of file MessageSvc.h.
|
private |
Definition at line 166 of file MessageSvc.h.
|
private |
Definition at line 172 of file MessageSvc.h.
typedef std::multimap< StatusCode, Message > MessageSvc::MessageMap |
Definition at line 35 of file MessageSvc.h.
typedef std::pair< std::string, std::ostream* > MessageSvc::NamedStream |
Definition at line 33 of file MessageSvc.h.
typedef std::multimap< int, NamedStream > MessageSvc::StreamMap |
Definition at line 34 of file MessageSvc.h.
typedef std::map< std::string, int > MessageSvc::ThresholdMap |
Definition at line 36 of file MessageSvc.h.
MessageSvc::MessageSvc | ( | const std::string & | name, |
ISvcLocator * | svcloc | ||
) |
Definition at line 26 of file MessageSvc.cpp.
|
virtual |
Definition at line 100 of file MessageSvc.cpp.
|
private |
Definition at line 461 of file MessageSvc.cpp.
|
inlinevirtual |
Get the default stream.
Implements IMessageSvc.
Definition at line 93 of file MessageSvc.h.
|
virtual |
Erase all messages associated to all status codes.
Implements IMessageSvc.
Definition at line 734 of file MessageSvc.cpp.
|
virtual |
Erase message associated to a given status code.
Implements IMessageSvc.
Definition at line 748 of file MessageSvc.cpp.
|
virtual |
Erase a given message associated to a given status code.
code | Status error code |
message | Message associated |
Implements IMessageSvc.
Definition at line 762 of file MessageSvc.cpp.
|
virtual |
|
virtual |
Delete all the streams for a given message type (severity level).
Implements IMessageSvc.
Definition at line 657 of file MessageSvc.cpp.
|
virtual |
Delete a single stream for a given message type (severity level)
type | Severity level |
stream | Pointer to a C++ stream |
Implements IMessageSvc.
Definition at line 669 of file MessageSvc.cpp.
|
virtual |
Delete all occurrences of a stream.
stream | Pointer to a C++ stream |
Implements IMessageSvc.
Definition at line 694 of file MessageSvc.cpp.
|
virtual |
Finalize Service.
Reimplemented from Service.
Definition at line 332 of file MessageSvc.cpp.
|
virtual |
Get the color codes for various log levels.
logLevel | Logging level |
Implements IMessageSvc.
Definition at line 828 of file MessageSvc.cpp.
|
virtual |
Increment deactivated message count.
Used by MsgStream to record the sources of messages that are prepared, but not printed (because if insufficient level).
Implements IInactiveMessageCounter.
Definition at line 846 of file MessageSvc.cpp.
|
private |
Definition at line 155 of file MessageSvc.cpp.
|
virtual |
Initialize Service.
Reimplemented from Service.
Definition at line 114 of file MessageSvc.cpp.
|
virtual |
Insert a message to be sent for a given status code into the error code repository.
code | Status error code |
message | Message associated |
Implements IMessageSvc.
Definition at line 719 of file MessageSvc.cpp.
|
virtual |
Add a new stream for a message type (severity level).
type | Severity level |
name | Stream name |
stream | Pointer to a C++ stream |
Implements IMessageSvc.
Definition at line 630 of file MessageSvc.cpp.
|
virtual |
Get the number of messages issued at a particular level.
Implements IMessageSvc.
Definition at line 838 of file MessageSvc.cpp.
|
virtual |
Retrieve the current output level threshold.
Implements IMessageSvc.
Definition at line 783 of file MessageSvc.cpp.
|
virtual |
Retrieve the current output level threshold for a given message source.
source | Message source. Typically the alg/svc name |
Implements IMessageSvc.
Definition at line 789 of file MessageSvc.cpp.
|
virtual |
Reinitialize Service.
Reimplemented from Service.
Definition at line 148 of file MessageSvc.cpp.
|
virtual |
Report a message by sending a Message object to the message service.
message | Reference to a message object |
Implements IMessageSvc.
Definition at line 556 of file MessageSvc.cpp.
|
virtual |
Report a message by sending a Message object to the message service.
message | Reference to a message object |
outputLevel | Output level of the message source for this message |
Implements IMessageSvc.
Definition at line 484 of file MessageSvc.cpp.
|
virtual |
Report an error to the message service.
The service will use the error code number for formating a human readable message
code | Error code number |
source | Message source. Typically the alg/svc name |
Implements IMessageSvc.
Definition at line 593 of file MessageSvc.cpp.
|
virtual |
Report a message by specifying the source, severity level and text.
The text is passed as C like character string to avoid extra copying.
source | Message source. Typically the alg/svc name |
type | Severity level |
message | Text message |
Implements IMessageSvc.
Definition at line 566 of file MessageSvc.cpp.
|
virtual |
Report a message by specifying the source, severity level and text.
source | Message source. Typically the alg/svc name |
type | Severity level |
message | Text message |
Implements IMessageSvc.
Definition at line 579 of file MessageSvc.cpp.
|
inlinevirtual |
Set the default stream.
stream | Pointer to a C++ stream |
Implements IMessageSvc.
Definition at line 98 of file MessageSvc.h.
|
virtual |
Set new global output level threshold.
Implements IMessageSvc.
Definition at line 805 of file MessageSvc.cpp.
|
virtual |
Set new output level threshold for a given message source.
source | Message source |
new_level | Severity level |
Implements IMessageSvc.
Definition at line 811 of file MessageSvc.cpp.
|
private |
Definition at line 197 of file MessageSvc.cpp.
|
private |
Definition at line 320 of file MessageSvc.cpp.
|
private |
Definition at line 249 of file MessageSvc.cpp.
|
private |
Definition at line 853 of file MessageSvc.cpp.
|
private |
Definition at line 276 of file MessageSvc.cpp.
|
private |
Definition at line 891 of file MessageSvc.cpp.
|
inlinevirtual |
|
private |
Definition at line 167 of file MessageSvc.h.
|
private |
Definition at line 138 of file MessageSvc.h.
|
private |
Default format for the messages.
Definition at line 135 of file MessageSvc.h.
|
private |
Default Message.
Definition at line 131 of file MessageSvc.h.
|
private |
Pointer to the output stream.
Definition at line 130 of file MessageSvc.h.
|
private |
Default format for timestamps in the messages.
Definition at line 136 of file MessageSvc.h.
|
private |
Definition at line 163 of file MessageSvc.h.
|
private |
Definition at line 162 of file MessageSvc.h.
|
private |
Definition at line 144 of file MessageSvc.h.
|
private |
Definition at line 141 of file MessageSvc.h.
|
private |
Definition at line 173 of file MessageSvc.h.
|
private |
Definition at line 171 of file MessageSvc.h.
|
private |
Message map.
Definition at line 133 of file MessageSvc.h.
|
mutableprivate |
Mutex to synchronize multiple access to m_messageMap.
Definition at line 190 of file MessageSvc.h.
|
private |
Definition at line 169 of file MessageSvc.h.
|
private |
Definition at line 142 of file MessageSvc.h.
|
mutableprivate |
Mutex to synchronize multiple threads printing.
Definition at line 187 of file MessageSvc.h.
|
private |
Definition at line 162 of file MessageSvc.h.
|
private |
Definition at line 140 of file MessageSvc.h.
|
private |
Definition at line 139 of file MessageSvc.h.
|
private |
Stream map.
Definition at line 132 of file MessageSvc.h.
|
private |
Definition at line 163 of file MessageSvc.h.
|
private |
Output level threshold map.
Definition at line 134 of file MessageSvc.h.
|
mutableprivate |
Mutex to synchronize multiple access to m_thresholdMap (.
Definition at line 194 of file MessageSvc.h.
|
private |
Properties controlling.
Definition at line 137 of file MessageSvc.h.