1 #ifndef GAUDI_MESSAGESVC_H
2 #define GAUDI_MESSAGESVC_H
17 #include <boost/thread/recursive_mutex.hpp>
18 #include <boost/array.hpp>
34 typedef std::multimap< int, NamedStream >
StreamMap;
63 virtual void reportMessage(
const std::string& source,
int type,
const std::string& message);
78 virtual void insertStream(
int message_type,
const std::string&
name, std::ostream* stream );
87 virtual void eraseStream(
int message_type, std::ostream* stream );
107 virtual int outputLevel(
const std::string& source)
const;
113 virtual void setOutputLevel(
const std::string& source,
int new_level);
119 virtual std::string
getLogColor(
int logLevel)
const;
126 const std::string& src );
165 std::string
colTrans(std::string,
int);
166 typedef std::map<std::string, MSG::Color>
ColorMap;
183 void tee(
const std::string& sourceName,
const std::string& logFileName,
184 const std::set<std::string>& declaredOutFileNames );
IntegerProperty m_msgLimit[MSG::NUM_LEVELS]
std::string colTrans(std::string, int)
virtual void setDefaultStream(std::ostream *stream)
Set the default stream.
std::ostream * m_defaultStream
Pointer to the output stream.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
boost::recursive_mutex m_reportMutex
Mutex to synchronize multiple threads printing.
std::multimap< int, NamedStream > StreamMap
virtual std::string getLogColor(int logLevel) const
Get the color codes for various log levels.
ArrayType msg
Internal array of counters.
StreamMap m_streamMap
Stream map.
virtual StatusCode initialize()
Initialize Service.
Message m_defaultMessage
Default Message.
MessageMap m_messageMap
Message map.
void setupLimits(Property &prop)
void setupInactCount(Property &prop)
int m_msgCount[MSG::NUM_LEVELS]
MessageSvc(const std::string &name, ISvcLocator *svcloc)
Base class used to extend a class implementing other interfaces.
virtual void setOutputLevel(int new_level)
Set new global output level threshold.
std::pair< std::string, std::ostream * > NamedStream
virtual StatusCode finalize()
Finalize Service.
std::map< std::string, int > ThresholdMap
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
UnsignedIntegerProperty m_statLevel
Private helper class to keep the count of messages of a type (MSG::LEVEL).
virtual void incrInactiveCount(MSG::Level level, const std::string &src)
Increment deactivated message count.
std::map< std::string, MsgAry > m_sourceMap
std::map< std::string, MSG::Color > ColorMap
virtual void insertStream(int message_type, const std::string &name, std::ostream *stream)
Add a new stream for a message type (severity level).
virtual void reportMessage(const Message &message)
Report a message by sending a Message object to the message service.
boost::array< int, MSG::NUM_LEVELS > ArrayType
Simple typedef for readability.
virtual void eraseStream()
Delete all the streams.
ThresholdMap m_thresholdMap
Output level threshold map.
virtual int outputLevel() const
Retrieve the current output level threshold.
This class is used for returning status codes from appropriate routines.
virtual const std::string & name() const
Retrieve name of the service.
std::multimap< StatusCode, Message > MessageMap
virtual StatusCode reinitialize()
Reinitialize Service.
std::map< std::string, std::ostream * > LoggedStreamsMap_t
StringArrayProperty m_thresholdProp[MSG::NUM_LEVELS]
Properties controlling.
Property base class allowing Property* collections to be "homogeneous".
std::string m_defaultFormat
Default format for the messages.
virtual bool useColor() const
Show whether colors are used.
void setupColors(Property &prop)
LoggedStreamsMap_t m_loggedStreams
virtual int messageCount(MSG::Level logLevel) const
Get the number of messages issued at a particular level.
std::map< std::string, MsgAry > m_inactiveMap
void initColors(Property &prop)
std::string m_logColorCodes[MSG::NUM_LEVELS]
BooleanProperty m_inactCount
MsgAry()
Default constructor.
void tee(const std::string &sourceName, const std::string &logFileName, const std::set< std::string > &declaredOutFileNames)
std::map< std::string, std::string > m_loggedStreamsName
BooleanProperty m_suppress
void setupThreshold(Property &prop)
virtual void eraseMessage()
Erase all messages associated to all status codes.
std::string m_defaultTimeFormat
Default format for timestamps in the messages.
virtual std::ostream * defaultStream() const
Get the default stream.
boost::recursive_mutex m_messageMapMutex
Mutex to synchronize multiple access to m_messageMap.
virtual void insertMessage(const StatusCode &code, const Message &message)
Insert a message to be sent for a given status code into the error code repository.
boost::recursive_mutex m_thresholdMapMutex
Mutex to synchronize multiple access to m_thresholdMap (.
StringArrayProperty m_logColors[MSG::NUM_LEVELS]