| The Gaudi Framework v32r1 (f65d50dc)

IMessageSvc.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_IMESSAGESVC_H
2 #define GAUDIKERNEL_IMESSAGESVC_H
3
4 // Include files
5 #include "GaudiKernel/IInterface.h"
6 #include <iostream>
7 #include <string>
8
9 // Forward declarations
10 class StatusCode;
11 class Message;
12
14 namespace MSG {
15 enum Level { NIL = 0, VERBOSE, DEBUG, INFO, WARNING, ERROR, FATAL, ALWAYS, NUM_LEVELS };
16 enum Color { BLACK = 0, RED, GREEN, YELLOW, BLUE, PURPLE, CYAN, WHITE, NUM_COLORS };
17 } // namespace MSG
18
19 #ifdef _WIN32
20 // Avoid (hopefully) conflicts between Windows' headers and MSG.
21 # ifndef NOMSG
22 # define NOMSG
23 # ifndef NOGDI
24 # define NOGDI
25 # endif
26 # endif
27 #endif
28
37 class GAUDI_API IMessageSvc : virtual public IInterface {
38 public:
40 DeclareInterfaceID( IMessageSvc, 2, 0 );
41
46 virtual void reportMessage( const Message& msg, int outputLevel ) = 0;
47
51 virtual void reportMessage( const Message& message ) = 0;
52
58 virtual void reportMessage( const StatusCode& code, const std::string& source = "" ) = 0;
59
65 virtual void reportMessage( const std::string& source, int type, const std::string& message ) = 0;
66
73 virtual void reportMessage( const char* source, int type, const char* message = "" ) = 0;
74
79 virtual void insertMessage( const StatusCode& code, const Message& message ) = 0;
80
82 virtual void eraseMessage() = 0;
83
85 virtual void eraseMessage( const StatusCode& code ) = 0;
86
91 virtual void eraseMessage( const StatusCode& code, const Message& message ) = 0;
92
98 virtual void insertStream( int type, const std::string& name, std::ostream* stream ) = 0;
99
101 virtual void eraseStream() = 0;
102
104 virtual void eraseStream( int message_type ) = 0;
105
110 virtual void eraseStream( int type, std::ostream* stream ) = 0;
111
115 virtual void eraseStream( std::ostream* stream ) = 0;
116
118 virtual std::ostream* defaultStream() const = 0;
119
123 virtual void setDefaultStream( std::ostream* stream ) = 0;
124
126 virtual int outputLevel() const = 0;
127
131 virtual int outputLevel( const std::string& source ) const = 0;
132
134 virtual void setOutputLevel( int new_level ) = 0;
135
140 virtual void setOutputLevel( const std::string& source, int new_level ) = 0;
141
144 virtual bool useColor() const = 0;
145
149 virtual std::string getLogColor( int logLevel ) const = 0;
150
153 virtual int messageCount( MSG::Level level ) const = 0;
154 };
155
156 class GAUDI_API IInactiveMessageCounter : virtual public IInterface {
157 public:
159 DeclareInterfaceID( IInactiveMessageCounter, 1, 0 );
160
165 virtual void incrInactiveCount( MSG::Level level, const std::string& src ) = 0;
166 };
167
168 #endif // GAUDIKERNEL_IMESSAGESVC_H
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
MSG::CYAN
Definition: IMessageSvc.h:16
MSG::GREEN
Definition: IMessageSvc.h:16
MSG::DEBUG
Definition: IMessageSvc.h:15
IInactiveMessageCounter
Definition: IMessageSvc.h:156
MSG::VERBOSE
Definition: IMessageSvc.h:15
MSG::WHITE
Definition: IMessageSvc.h:16
std::string
STL class.
MSG::FATAL
Definition: IMessageSvc.h:15
MSG::Level
Level
Definition: IMessageSvc.h:15
MSG::RED
Definition: IMessageSvc.h:16
MSG::BLUE
Definition: IMessageSvc.h:16
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
IInterface
Definition of the basic interface.
Definition: IInterface.h:244
gaudirun.type
type
Definition: gaudirun.py:142
IMessageSvc
The IMessage is the interface implemented by the message service.
Definition: IMessageSvc.h:37
MSG::NUM_COLORS
Definition: IMessageSvc.h:16
MSG::NIL
Definition: IMessageSvc.h:15
DeclareInterfaceID
#define DeclareInterfaceID(iface, major, minor)
Macro to declare the interface ID when using the new mechanism of extending and implementing interfac...
Definition: IInterface.h:13
Message
The Message class.
Definition: Message.h:17
MSG::NUM_LEVELS
Definition: IMessageSvc.h:15
MSG
Print levels enumeration.
Definition: IMessageSvc.h:14
MSG::BLACK
Definition: IMessageSvc.h:16
GaudiMP.FdsRegistry.msg
msg
Definition: FdsRegistry.py:8
MSG::ERROR
Definition: IMessageSvc.h:15
MSG::PURPLE
Definition: IMessageSvc.h:16
gaudirun.level
level
Definition: gaudirun.py:334
MSG::WARNING
Definition: IMessageSvc.h:15
MSG::INFO
Definition: IMessageSvc.h:15
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:71
IInterface.h
MSG::YELLOW
Definition: IMessageSvc.h:16
std::ostream
STL class.
MSG::ALWAYS
Definition: IMessageSvc.h:15
MSG::Color
Color
Definition: IMessageSvc.h:16