5#ifndef ATHENASERVICES_LOGGEDMESSAGESVC_H
6#define ATHENASERVICES_LOGGEDMESSAGESVC_H 1
16#include "GaudiKernel/StatusCode.h"
17#include "GaudiKernel/Service.h"
18#include "GaudiKernel/IMessageSvc.h"
19#include "GaudiKernel/Message.h"
20#include "Gaudi/Property.h"
38 public extends<AthService, ILoggedMessageSvc, IInactiveMessageCounter> {
42 typedef std::multimap< int, NamedStream >
StreamMap;
56 virtual StatusCode
finalize()
override;
59 virtual void reportMessage(
const Message& message )
override;
65 virtual void reportMessage(
const StatusCode& code, std::string_view source =
"")
override;
68 virtual void reportMessage( std::string source,
int type, std::string message)
override;
71 virtual void insertMessage(
const StatusCode& code, Message message )
override;
77 virtual void eraseMessage(
const StatusCode& code )
override;
80 virtual void eraseMessage(
const StatusCode& code,
const Message& message )
override;
83 virtual void insertStream(
int message_type, std::string name, std::ostream* stream )
override;
89 virtual void eraseStream(
int message_type )
override;
92 virtual void eraseStream(
int message_type, std::ostream* stream )
override;
95 virtual void eraseStream( std::ostream* stream )
override;
113 virtual int outputLevel(std::string_view source)
const override;
119 virtual void setOutputLevel(std::string_view source,
int new_level)
override;
125 virtual std::string
getLogColor(
int logLevel)
const override;
128 virtual int messageCount( MSG::Level logLevel )
const override;
132 std::string_view src )
override;
134 virtual std::vector< std::pair<std::string, std::string> >
getMessages( MSG::Level level)
const override;
136 virtual std::vector< LoggedMessage >
getKeyMessages()
const override;
160 std::array<int, MSG::NUM_LEVELS>
msg = {{0}};
168 std::string
colTrans(
const std::string&,
int);
169 typedef std::map<std::string, MSG::Color>
ColorMap;
178 void initColors(Gaudi::Details::PropertyBase& prop);
179 void setupColors(Gaudi::Details::PropertyBase& prop);
180 void setupLimits(Gaudi::Details::PropertyBase& prop);
186 void tee(
const std::string& sourceName,
const std::string& logFileName,
187 const std::set<std::string>& declaredOutFileNames );
199 std::vector< std::pair<std::string, std::string> >
m_msgLog[ MSG::NUM_LEVELS ];
Define macros for attributes used to control the static checker.
MessageMap m_messageMap
Message map.
void initColors(Gaudi::Details::PropertyBase &prop)
virtual void insertStream(int message_type, std::string name, std::ostream *stream) override
virtual int messageCount(MSG::Level logLevel) const override
LoggedStreamsMap_t m_loggedStreams
void setupLimits(Gaudi::Details::PropertyBase &prop)
virtual void eraseStream() override
LoggedMessageSvc(const std::string &name, ISvcLocator *svcloc)
StreamMap m_streamMap
Stream map.
void setupColors(Gaudi::Details::PropertyBase &prop)
UnsignedIntegerProperty m_statLevel
std::map< std::string, MSG::Color > ColorMap
void tee(const std::string &sourceName, const std::string &logFileName, const std::set< std::string > &declaredOutFileNames)
virtual StatusCode initialize() override
Initialize Service.
std::mutex m_reportMutex
Mutex to synchronize multiple threads printing.
virtual void setOutputLevel(int new_level) override
std::multimap< StatusCode, Message > MessageMap
std::vector< LoggedMessage > m_msgKeyLog
std::pair< std::string, std::ostream * > NamedStream
virtual std::string getLogColor(int logLevel) const override
IntegerProperty m_msgLimit[MSG::NUM_LEVELS]
virtual StatusCode reinitialize() override
Reinitialize Service.
std::vector< std::pair< std::string, std::string > > m_msgLog[MSG::NUM_LEVELS]
std::map< std::string, MsgAry, std::less<> > m_sourceMap
std::map< std::string, std::ostream * > LoggedStreamsMap_t
BooleanProperty m_inactCount
virtual bool useColor() const override
Message m_defaultMessage
Default Message.
virtual StatusCode finalize() override
Finalize Service.
ThresholdMap m_thresholdMap
Output level threshold map.
virtual std::vector< std::pair< std::string, std::string > > getMessages(MSG::Level level) const override
std::mutex m_thresholdMapMutex
Mutex to synchronize multiple access to m_thresholdMap (.
virtual ~LoggedMessageSvc()
int m_msgCount[MSG::NUM_LEVELS]
StringArrayProperty m_thresholdProp[MSG::NUM_LEVELS]
Properties controling.
virtual std::ostream *defaultStream ATLAS_NOT_CONST_THREAD_SAFE() const override
std::string m_defaultTimeFormat
Default format for timestamps in the messages.
virtual void reportMessage(const Message &message) override
StringArrayProperty m_logColors[MSG::NUM_LEVELS]
virtual void setDefaultStream(std::ostream *stream) override
std::string colTrans(const std::string &, int)
std::multimap< int, NamedStream > StreamMap
std::map< std::string, MsgAry, std::less<> > m_inactiveMap
virtual void insertMessage(const StatusCode &code, Message message) override
virtual int outputLevel() const override
std::ostream * m_defaultStream
Pointer to the output stream.
std::map< std::string, std::string > m_loggedStreamsName
IntegerProperty m_logLevel
std::map< std::string, int, std::less<> > ThresholdMap
void setupThreshold(Gaudi::Details::PropertyBase &prop)
void setupInactCount(Gaudi::Details::PropertyBase &prop)
virtual std::vector< LoggedMessage > getKeyMessages() const override
std::string m_logColorCodes[MSG::NUM_LEVELS]
std::string m_defaultFormat
Default format for the messages.
StringArrayProperty m_keywords
virtual void incrInactiveCount(MSG::Level level, std::string_view src) override
BooleanProperty m_suppress
std::recursive_mutex m_messageMapMutex
Mutex to synchronize multiple access to m_messageMap.
virtual void eraseMessage() override
MsgAry()=default
Default constructor.
std::array< int, MSG::NUM_LEVELS > msg
Internal array of counters.