1 #ifndef GAUDI_MESSAGESVC_H
2 #define GAUDI_MESSAGESVC_H
13 #include "GaudiKernel/StatusCode.h"
14 #include "GaudiKernel/Service.h"
15 #include "GaudiKernel/IMessageSvc.h"
16 #include "GaudiKernel/Message.h"
17 #include "GaudiKernel/Property.h"
33 typedef std::multimap< int, NamedStream >
StreamMap;
62 void reportMessage(
const std::string& source,
int type,
const std::string& message)
override;
77 void insertStream(
int message_type,
const std::string&
name, std::ostream* stream )
override;
86 void eraseStream(
int message_type, std::ostream* stream )
override;
106 int outputLevel(
const std::string& source)
const override;
112 void setOutputLevel(
const std::string& source,
int new_level)
override;
118 std::string
getLogColor(
int logLevel)
const override;
125 const std::string& src )
override;
155 std::array<int,MSG::NUM_LEVELS>
msg = {{0}};
163 std::string
colTrans(std::string,
int);
164 typedef std::map<std::string, MSG::Color>
ColorMap;
180 void tee(
const std::string& sourceName,
const std::string& logFileName,
181 const std::set<std::string>& declaredOutFileNames );
IntegerProperty m_msgLimit[MSG::NUM_LEVELS]
std::string colTrans(std::string, int)
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...
std::multimap< int, NamedStream > StreamMap
StreamMap m_streamMap
Stream map.
std::array< int, MSG::NUM_LEVELS > m_msgCount
virtual void i_reportMessage(const Message &msg, int outputLevel)
Internal implementation of reportMessage(const Message&,int) without lock.
Message m_defaultMessage
Default Message.
MessageMap m_messageMap
Message map.
void setupLimits(Property &prop)
void setupInactCount(Property &prop)
MessageSvc(const std::string &name, ISvcLocator *svcloc)
std::recursive_mutex m_messageMapMutex
Mutex to synchronize multiple access to m_messageMap.
StatusCode reinitialize() override
Reinitialize Service.
std::pair< std::string, std::ostream * > NamedStream
void eraseMessage() override
std::map< std::string, int > ThresholdMap
UnsignedIntegerProperty m_statLevel
void eraseStream() override
void incrInactiveCount(MSG::Level level, const std::string &src) override
std::map< std::string, std::shared_ptr< std::ostream > > m_loggedStreams
Private helper class to keep the count of messages of a type (MSG::LEVEL).
std::map< std::string, MsgAry > m_sourceMap
std::map< std::string, MSG::Color > ColorMap
bool useColor() const override
std::string getLogColor(int logLevel) const override
void setOutputLevel(int new_level) override
StatusCode initialize() override
Initialize Service.
ThresholdMap m_thresholdMap
Output level threshold map.
This class is used for returning status codes from appropriate routines.
void reportMessage(const Message &message) override
std::recursive_mutex m_reportMutex
Mutex to synchronize multiple threads printing.
std::multimap< StatusCode, Message > MessageMap
MsgAry()=default
Default constructor.
StringArrayProperty m_thresholdProp[MSG::NUM_LEVELS]
Properties controlling.
Property base class allowing Property* collections to be "homogeneous".
StatusCode finalize() override
Finalize Service.
Base class used to extend a class implementing other interfaces.
~MessageSvc() override=default
std::string m_defaultFormat
Default format for the messages.
std::ostream * defaultStream() const override
void setupColors(Property &prop)
std::map< std::string, MsgAry > m_inactiveMap
void initColors(Property &prop)
std::string m_logColorCodes[MSG::NUM_LEVELS]
int messageCount(MSG::Level logLevel) const override
BooleanProperty m_inactCount
int outputLevel() const override
void tee(const std::string &sourceName, const std::string &logFileName, const std::set< std::string > &declaredOutFileNames)
std::map< std::string, std::string > m_loggedStreamsName
void insertMessage(const StatusCode &code, const Message &message) override
BooleanProperty m_suppress
void setupThreshold(Property &prop)
std::array< int, MSG::NUM_LEVELS > msg
Internal array of counters.
std::string m_defaultTimeFormat
Default format for timestamps in the messages.
void insertStream(int message_type, const std::string &name, std::ostream *stream) override
void setDefaultStream(std::ostream *stream) override
StringArrayProperty m_logColors[MSG::NUM_LEVELS]
std::recursive_mutex m_thresholdMapMutex
Mutex to synchronize multiple access to m_thresholdMap (.