The Gaudi Framework  v33r0 (d5ea422b)
IMessageSvc.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifndef GAUDIKERNEL_IMESSAGESVC_H
12 #define GAUDIKERNEL_IMESSAGESVC_H
13 
14 // Include files
15 #include "GaudiKernel/IInterface.h"
16 #include <iostream>
17 #include <string>
18 
19 // Forward declarations
20 class StatusCode;
21 class Message;
22 
24 namespace MSG {
27 } // namespace MSG
28 
29 #ifdef _WIN32
30 // Avoid (hopefully) conflicts between Windows' headers and MSG.
31 # ifndef NOMSG
32 # define NOMSG
33 # ifndef NOGDI
34 # define NOGDI
35 # endif
36 # endif
37 #endif
38 
47 class GAUDI_API IMessageSvc : virtual public IInterface {
48 public:
51 
56  virtual void reportMessage( const Message& msg, int outputLevel ) = 0;
57 
61  virtual void reportMessage( const Message& message ) = 0;
62 
68  virtual void reportMessage( const StatusCode& code, const std::string& source = "" ) = 0;
69 
75  virtual void reportMessage( const std::string& source, int type, const std::string& message ) = 0;
76 
83  virtual void reportMessage( const char* source, int type, const char* message = "" ) = 0;
84 
89  virtual void insertMessage( const StatusCode& code, const Message& message ) = 0;
90 
92  virtual void eraseMessage() = 0;
93 
95  virtual void eraseMessage( const StatusCode& code ) = 0;
96 
101  virtual void eraseMessage( const StatusCode& code, const Message& message ) = 0;
102 
108  virtual void insertStream( int type, const std::string& name, std::ostream* stream ) = 0;
109 
111  virtual void eraseStream() = 0;
112 
114  virtual void eraseStream( int message_type ) = 0;
115 
120  virtual void eraseStream( int type, std::ostream* stream ) = 0;
121 
125  virtual void eraseStream( std::ostream* stream ) = 0;
126 
128  virtual std::ostream* defaultStream() const = 0;
129 
133  virtual void setDefaultStream( std::ostream* stream ) = 0;
134 
136  virtual int outputLevel() const = 0;
137 
141  virtual int outputLevel( const std::string& source ) const = 0;
142 
144  virtual void setOutputLevel( int new_level ) = 0;
145 
150  virtual void setOutputLevel( const std::string& source, int new_level ) = 0;
151 
154  virtual bool useColor() const = 0;
155 
159  virtual std::string getLogColor( int logLevel ) const = 0;
160 
163  virtual int messageCount( MSG::Level level ) const = 0;
164 };
165 
167 public:
170 
175  virtual void incrInactiveCount( MSG::Level level, const std::string& src ) = 0;
176 };
177 
178 #endif // GAUDIKERNEL_IMESSAGESVC_H
STL class.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
Definition of the basic interface.
Definition: IInterface.h:254
The IMessage is the interface implemented by the message service.
Definition: IMessageSvc.h:47
#define DeclareInterfaceID(iface, major, minor)
Macro to declare the interface ID when using the new mechanism of extending and implementing interfac...
Definition: IInterface.h:23
The Message class.
Definition: Message.h:27
Print levels enumeration.
Definition: IMessageSvc.h:24
#define GAUDI_API
Definition: Kernel.h:81
STL class.