| # Gaudi Framework, version v21r10p1 |

Home |  | Generated: 29 Jul 2010

# IMessageSvc.h

Go to the documentation of this file.

    00001 // $Header: /tmp/svngaudi/tmp.jEpFh25751/Gaudi/GaudiKernel/GaudiKernel/IMessageSvc.h,v 1.8 2008/10/01 14:39:27 marcocle Exp $
    00002 #ifndef GAUDIKERNEL_IMESSAGESVC_H
    00003 #define GAUDIKERNEL_IMESSAGESVC_H
    00004
    00005 // Include files
    00006 #include "GaudiKernel/IInterface.h"
    00007 #include <iostream>
    00008 #include <string>
    00009
    00010 // Forward declarations
    00011 class StatusCode;
    00012 class Message;
    00013
    00015 namespace MSG {
    00016   enum Level {
    00017     NIL = 0,
    00018     VERBOSE,
    00019     DEBUG,
    00020     INFO,
    00021     WARNING,
    00022     ERROR,
    00023     FATAL,
    00024     ALWAYS,
    00025     NUM_LEVELS
    00026   };
    00027   enum Color {
    00028     BLACK = 0,
    00029     RED,
    00030     GREEN,
    00031     YELLOW,
    00032     BLUE,
    00033     PURPLE,
    00034     CYAN,
    00035     WHITE,
    00036     NUM_COLORS
    00037   };
    00038 }
    00039
    00040 #ifdef _WIN32
    00041 // Avoid (hopefully) conflicts between Windows' headers and MSG.
    00042 #  ifndef NOMSG
    00043 #    define NOMSG
    00044 #    ifndef NOGDI
    00045 #      define NOGDI
    00046 #    endif
    00047 #  endif
    00048 #endif
    00049
    00058 class GAUDI_API IMessageSvc: virtual public IInterface {
    00059 public:
    00061   DeclareInterfaceID(IMessageSvc,2,0);
    00062
    00067   virtual void reportMessage( const Message& msg, int outputLevel ) = 0;
    00068
    00072   virtual void reportMessage( const Message& message ) = 0;
    00073
    00079   virtual void reportMessage( const StatusCode& code,
    00080                               const std::string& source = "" ) = 0;
    00081
    00087   virtual void reportMessage( const std::string& source,
    00088                               int type,
    00089                               const std::string& message ) = 0;
    00090
    00097   virtual void reportMessage( const char* source,
    00098                               int type,
    00099                               const char* message = "" ) = 0;
    00100
    00105   virtual void insertMessage( const StatusCode& code,
    00106                               const Message& message ) = 0;
    00107
    00109   virtual void eraseMessage() = 0;
    00110
    00112   virtual void eraseMessage( const StatusCode& code ) = 0;
    00113
    00118   virtual void eraseMessage( const StatusCode& code,
    00119                              const Message& message  ) = 0;
    00120
    00126   virtual void insertStream( int type,
    00127                              const std::string& name,
    00128                              std::ostream* stream ) = 0;
    00129
    00131   virtual void eraseStream() = 0;
    00132
    00134   virtual void eraseStream( int message_type ) = 0;
    00135
    00140   virtual void eraseStream( int type,
    00141                             std::ostream* stream ) = 0;
    00142
    00146   virtual void eraseStream( std::ostream* stream ) = 0;
    00147
    00149   virtual std::ostream* defaultStream() const = 0;
    00150
    00154   virtual void setDefaultStream( std::ostream* stream ) = 0;
    00155
    00157   virtual int outputLevel()   const = 0;
    00158
    00162   virtual int outputLevel( const std::string& source ) const = 0;
    00163
    00165   virtual void setOutputLevel( int new_level )  = 0;
    00166
    00171   virtual void setOutputLevel( const std::string& source,
    00172                                int new_level)  = 0;
    00173
    00174
    00177   virtual bool useColor() const = 0;
    00178
    00182   virtual std::string getLogColor(int logLevel) const = 0;
    00183
    00186   virtual int messageCount( MSG::Level level ) const = 0;
    00187
    00188
    00189 };
    00190
    00191 #endif // GAUDIKERNEL_IMESSAGESVC_H