The Gaudi Framework  master (37c0b60a)
IMessageSvc Class Referenceabstract

#include <GaudiKernel/IMessageSvc.h>

Inheritance diagram for IMessageSvc:
Collaboration diagram for IMessageSvc:

Public Member Functions

 DeclareInterfaceID (IMessageSvc, 2, 0)
 InterfaceID. More...
 
virtual void reportMessage (const Message &msg, int outputLevel)=0
 Report a message by sending a Message object to the message service. More...
 
virtual void reportMessage (const Message &message)=0
 Report a message by sending a Message object to the message service. More...
 
virtual void reportMessage (const StatusCode &code, std::string_view source="")=0
 Report an error to the message service. More...
 
virtual void reportMessage (std::string source, int type, std::string message)=0
 Report a message by specifying the source, severity level and text. More...
 
virtual void insertMessage (const StatusCode &code, Message message)=0
 Insert a message to be sent for a given status code into the error code repository. More...
 
virtual void eraseMessage ()=0
 Erase all messages associated to all status codes. More...
 
virtual void eraseMessage (const StatusCode &code)=0
 Erase message associated to a given status code. More...
 
virtual void eraseMessage (const StatusCode &code, const Message &message)=0
 Erase a given message associated to a given status code. More...
 
virtual void insertStream (int type, std::string name, std::ostream *stream)=0
 Add a new stream for a message type (severity level). More...
 
virtual void eraseStream ()=0
 Delete all the streams. More...
 
virtual void eraseStream (int message_type)=0
 Delete all the streams for a given message type (severity level). More...
 
virtual void eraseStream (int type, std::ostream *stream)=0
 Delete a single stream for a given message type (severity level) More...
 
virtual void eraseStream (std::ostream *stream)=0
 Delete all occurrences of a stream. More...
 
virtual std::ostreamdefaultStream () const =0
 Get the default stream. More...
 
virtual void setDefaultStream (std::ostream *stream)=0
 Set the default stream. More...
 
virtual int outputLevel () const =0
 Retrieve the current output level threshold. More...
 
virtual int outputLevel (std::string_view source) const =0
 Retrieve the current output level threshold for a given message source. More...
 
virtual void setOutputLevel (int new_level)=0
 Set new global output level threshold. More...
 
virtual void setOutputLevel (std::string_view source, int new_level)=0
 Set new output level threshold for a given message source. More...
 
virtual bool useColor () const =0
 Show whether colors are used. More...
 
virtual std::string getLogColor (int logLevel) const =0
 Get the color codes for various log levels. More...
 
virtual int messageCount (MSG::Level level) const =0
 Get the number of messages issued at a particular level. More...
 
- Public Member Functions inherited from IInterface
virtual void * i_cast (const InterfaceID &) const =0
 main cast function More...
 
virtual std::vector< std::stringgetInterfaceNames () const =0
 Returns a vector of strings containing the names of all the implemented interfaces. More...
 
virtual unsigned long addRef ()=0
 Increment the reference count of Interface instance. More...
 
virtual unsigned long release ()=0
 Release Interface instance. More...
 
virtual unsigned long refCount () const =0
 Current reference count. More...
 
virtual StatusCode queryInterface (const InterfaceID &ti, void **pp)=0
 Set the void** to the pointer to the requested interface of the instance. More...
 
virtual ~IInterface ()=default
 Virtual destructor. More...
 

Additional Inherited Members

- Public Types inherited from IInterface
enum  Status : StatusCode::code_t {
  Status::FAILURE = 0, Status::SUCCESS = 1, Status::NO_INTERFACE, Status::VERSMISMATCH,
  Status::LAST_ERROR
}
 Return status. More...
 
using iid = Gaudi::InterfaceId< IInterface, 0, 0 >
 Interface ID. More...
 
using ext_iids = Gaudi::interface_list< iid >
 Extra interfaces. More...
 
- Static Public Member Functions inherited from IInterface
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface. More...
 

Detailed Description

The IMessage is the interface implemented by the message service. This interface is used by any algorithm or services wanting to report messages to the end-user.

Author
Iain Last

Definition at line 47 of file IMessageSvc.h.

Member Function Documentation

◆ DeclareInterfaceID()

IMessageSvc::DeclareInterfaceID ( IMessageSvc  ,
,
 
)

◆ defaultStream()

virtual std::ostream* IMessageSvc::defaultStream ( ) const
pure virtual

Get the default stream.

◆ eraseMessage() [1/3]

virtual void IMessageSvc::eraseMessage ( )
pure virtual

Erase all messages associated to all status codes.

◆ eraseMessage() [2/3]

virtual void IMessageSvc::eraseMessage ( const StatusCode code)
pure virtual

Erase message associated to a given status code.

◆ eraseMessage() [3/3]

virtual void IMessageSvc::eraseMessage ( const StatusCode code,
const Message message 
)
pure virtual

Erase a given message associated to a given status code.

Parameters
codeStatus error code
messageMessage associated

◆ eraseStream() [1/4]

virtual void IMessageSvc::eraseStream ( )
pure virtual

Delete all the streams.

◆ eraseStream() [2/4]

virtual void IMessageSvc::eraseStream ( int  message_type)
pure virtual

Delete all the streams for a given message type (severity level).

◆ eraseStream() [3/4]

virtual void IMessageSvc::eraseStream ( int  type,
std::ostream stream 
)
pure virtual

Delete a single stream for a given message type (severity level)

Parameters
typeSeverity level
streamPointer to a C++ stream

◆ eraseStream() [4/4]

virtual void IMessageSvc::eraseStream ( std::ostream stream)
pure virtual

Delete all occurrences of a stream.

Parameters
streamPointer to a C++ stream

◆ getLogColor()

virtual std::string IMessageSvc::getLogColor ( int  logLevel) const
pure virtual

Get the color codes for various log levels.

Parameters
logLevelLogging level

◆ insertMessage()

virtual void IMessageSvc::insertMessage ( const StatusCode code,
Message  message 
)
pure virtual

Insert a message to be sent for a given status code into the error code repository.

Parameters
codeStatus error code
messageMessage associated

◆ insertStream()

virtual void IMessageSvc::insertStream ( int  type,
std::string  name,
std::ostream stream 
)
pure virtual

Add a new stream for a message type (severity level).

Parameters
typeSeverity level
nameStream name
streamPointer to a C++ stream

◆ messageCount()

virtual int IMessageSvc::messageCount ( MSG::Level  level) const
pure virtual

Get the number of messages issued at a particular level.

◆ outputLevel() [1/2]

virtual int IMessageSvc::outputLevel ( ) const
pure virtual

Retrieve the current output level threshold.

◆ outputLevel() [2/2]

virtual int IMessageSvc::outputLevel ( std::string_view  source) const
pure virtual

Retrieve the current output level threshold for a given message source.

Parameters
sourceMessage source. Typically the alg/svc name

◆ reportMessage() [1/4]

virtual void IMessageSvc::reportMessage ( const Message message)
pure virtual

Report a message by sending a Message object to the message service.

Parameters
messageReference to a message object

◆ reportMessage() [2/4]

virtual void IMessageSvc::reportMessage ( const Message msg,
int  outputLevel 
)
pure virtual

Report a message by sending a Message object to the message service.

Parameters
messageReference to a message object
outputLevelOutput level of the message source for this message

◆ reportMessage() [3/4]

virtual void IMessageSvc::reportMessage ( const StatusCode code,
std::string_view  source = "" 
)
pure virtual

Report an error to the message service.

The service will use the error code number for formating a human readable message

Parameters
codeError code number
sourceMessage source. Typically the alg/svc name

◆ reportMessage() [4/4]

virtual void IMessageSvc::reportMessage ( std::string  source,
int  type,
std::string  message 
)
pure virtual

Report a message by specifying the source, severity level and text.

Parameters
sourceMessage source. Typically the alg/svc name
typeSeverity level
messageText message

◆ setDefaultStream()

virtual void IMessageSvc::setDefaultStream ( std::ostream stream)
pure virtual

Set the default stream.

Parameters
streamPointer to a C++ stream

◆ setOutputLevel() [1/2]

virtual void IMessageSvc::setOutputLevel ( int  new_level)
pure virtual

Set new global output level threshold.

◆ setOutputLevel() [2/2]

virtual void IMessageSvc::setOutputLevel ( std::string_view  source,
int  new_level 
)
pure virtual

Set new output level threshold for a given message source.

Parameters
sourceMessage source
new_levelSeverity level

◆ useColor()

virtual bool IMessageSvc::useColor ( ) const
pure virtual

Show whether colors are used.


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