| # Gaudi Framework, version v20r4
Generated: 8 Jan 2009

# 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
    00014 // Declaration of the interface ID ( interface id, major version, minor version)
    00015 static const InterfaceID IID_IMessageSvc(30, 1 , 1);
    00016
    00018 namespace MSG   {
    00019   enum Level   {
    00020         NIL = 0,
    00021         VERBOSE,
    00022         DEBUG,
    00023         INFO,
    00024         WARNING,
    00025         ERROR,
    00026         FATAL,
    00027         ALWAYS,
    00028         NUM_LEVELS
    00029   };
    00030   enum Color   {
    00031         BLACK = 0,
    00032         RED,
    00033         GREEN,
    00034         YELLOW,
    00035         BLUE,
    00036         PURPLE,
    00037         CYAN,
    00038         WHITE,
    00039         NUM_COLORS
    00040   };
    00041 }
    00042
    00051 class IMessageSvc : virtual public IInterface {
    00052 public:
    00053
    00055   static const InterfaceID& interfaceID() { return IID_IMessageSvc; }
    00056
    00061   virtual void reportMessage( const Message& msg, int outputLevel ) = 0;
    00062
    00066   virtual void reportMessage( const Message& message ) = 0;
    00067
    00073   virtual void reportMessage( const StatusCode& code,
    00074                               const std::string& source = "" ) = 0;
    00075
    00081   virtual void reportMessage( const std::string& source,
    00082                               int type,
    00083                               const std::string& message ) = 0;
    00084
    00091   virtual void reportMessage( const char* source,
    00092                               int type,
    00093                               const char* message = "" ) = 0;
    00094
    00099   virtual void insertMessage( const StatusCode& code,
    00100                               const Message& message ) = 0;
    00101
    00103   virtual void eraseMessage() = 0;
    00104
    00106   virtual void eraseMessage( const StatusCode& code ) = 0;
    00107
    00112   virtual void eraseMessage( const StatusCode& code,
    00113                              const Message& message  ) = 0;
    00114
    00120   virtual void insertStream( int type,
    00121                              const std::string& name,
    00122                              std::ostream* stream ) = 0;
    00123
    00125   virtual void eraseStream() = 0;
    00126
    00128   virtual void eraseStream( int message_type ) = 0;
    00129
    00134   virtual void eraseStream( int type,
    00135                             std::ostream* stream ) = 0;
    00136
    00140   virtual void eraseStream( std::ostream* stream ) = 0;
    00141
    00143   virtual std::ostream* defaultStream() const = 0;
    00144
    00148   virtual void setDefaultStream( std::ostream* stream ) = 0;
    00149
    00151   virtual int outputLevel()   const = 0;
    00152
    00156   virtual int outputLevel( const std::string& source ) const = 0;
    00157
    00159   virtual void setOutputLevel( int new_level )  = 0;
    00160
    00165   virtual void setOutputLevel( const std::string& source,
    00166                                int new_level)  = 0;
    00167
    00168
    00171   virtual bool useColor() const = 0;
    00172
    00176   virtual std::string getLogColor(int logLevel) const = 0;
    00177
    00180   virtual int messageCount( MSG::Level level ) const = 0;
    00181
    00182
    00183 };
    00184
    00185 #endif // GAUDIKERNEL_IMESSAGESVC_H