|
ATLAS Offline Software
|
Go to the documentation of this file.
4 #ifndef TRIGSERVICES_TRIGMESSAGESVC_H
5 #define TRIGSERVICES_TRIGMESSAGESVC_H
17 #include "tbb/concurrent_queue.h"
23 #include "GaudiKernel/IIncidentListener.h"
24 #include "GaudiKernel/IMessageSvc.h"
25 #include "GaudiKernel/Message.h"
26 #include "Gaudi/Property.h"
27 #include "GaudiKernel/Service.h"
28 #include "GaudiKernel/StatusCode.h"
31 #define NOTSUPPORTED \
32 throw std::logic_error(std::string(__func__) + " is not supported by TrigMessageSvc")
56 class TrigMessageSvc :
public extends<Service, IMessageSvc, IIncidentListener> {
67 virtual void handle(
const Incident& incident )
override;
89 virtual std::string
getLogColor(
int)
const override {
return ""; }
108 Gaudi::Property<std::string>
m_defaultFormat{
this,
"Format", Message::getDefaultFormat(),
109 "Default message format"};
110 Gaudi::Property<std::string>
m_ersFormat{
this,
"ErsFormat", Message::getDefaultFormat(),
111 "ERS message format"};
113 this,
"timeFormat", Message::getDefaultTimeFormat(),
"Message time format"};
114 Gaudi::Property<bool>
m_stats{
this,
"showStats",
false,
"Show message statistics"};
116 "Show total message statistics for >= level"};
118 "Publish message statistics for this and higher message levels"};
120 "Print event ID for this and higher message levels"};
121 Gaudi::Property<bool>
m_color{
this,
"useColors",
false,
122 "Colors are not supported by TrigMessageSvc"};
123 Gaudi::Property<bool>
m_suppress{
this,
"enableSuppression",
false,
"Enable message suppression"};
125 "Use message suppression only during RUNNING state"};
129 {
this,
"setVerbose"},
132 {
this,
"setWarning"},
135 {
this,
"setAlways"}}};
138 {
this,
"verboseLimit", 500},
139 {
this,
"debugLimit", 500},
140 {
this,
"infoLimit", 500},
141 {
this,
"warningLimit", 500},
142 {
this,
"errorLimit", 500},
143 {
this,
"fatalLimit", 500},
144 {
this,
"alwaysLimit", 0}}};
157 {
this,
"useErsVerbose", {}},
158 {
this,
"useErsDebug", {}},
159 {
this,
"useErsInfo", {}},
160 {
this,
"useErsWarning", {}},
161 {
this,
"useErsError", {}},
162 {
this,
"useErsFatal", {}},
163 {
this,
"useErsAlways", {}}}};
166 "Maximum number of messages (per event and level) that are forwarded to ERS (-1: disabled)"};
177 std::array<int, MSG::NUM_LEVELS>
msg = {{0}};
185 std::unordered_map<EventContext::ContextID_t,
200 void setupLimits(Gaudi::Details::PropertyBase& prop);
virtual void eraseMessage() override
void setupThreshold(Gaudi::Details::PropertyBase &prop)
tbb::concurrent_bounded_queue< std::function< void()> > m_messageActionsQueue
Private helper class to keep the count of messages of a type (MSG::LEVEL).
Gaudi::Property< std::string > m_defaultFormat
std::array< int, MSG::NUM_LEVELS > msg
Internal array of counters.
ThresholdMap m_thresholdMap
Output level threshold map.
virtual int messageCount(MSG::Level logLevel) const override
std::array< int, MSG::NUM_LEVELS > m_msgCount
counts per level
virtual void eraseStream() override
logLevel
If HLT PSK is set on command line read it from DB instead of COOL (ATR-25974)
TH1I * m_msgCountHist
Message counting per level histogram.
std::array< Gaudi::Property< int >, MSG::NUM_LEVELS > m_msgLimit
virtual void eraseStream(int) override
Gaudi::Property< std::string > m_ersFormat
virtual void eraseMessage(const StatusCode &, const Message &) override
virtual std::string getLogColor(int) const override
TrigMessageSvc(const std::string &name, ISvcLocator *svcloc)
std::recursive_mutex m_thresholdMapMutex
virtual StatusCode initialize() override
virtual int outputLevel() const override
Gaudi::Property< int > m_ersEventLimit
bool m_doPublish
are we publishing message statistics?
::StatusCode StatusCode
StatusCode definition for legacy code.
std::map< std::string, MsgAry > m_sourceMap
counts per source
TH2I * m_msgCountSrcHist
Message counting per message source.
virtual void setOutputLevel(int new_level) override
virtual void insertMessage(const StatusCode &, Message) override
virtual void handle(const Incident &incident) override
std::array< Gaudi::Property< std::vector< std::string > >, MSG::NUM_LEVELS > m_thresholdProp
virtual void reportMessage(const Message &message) override
MessageSvc used by the HLT applications.
Gaudi::Property< unsigned int > m_eventIDLevel
MsgAry()=default
Default constructor.
bool passErsFilter(const std::string &source, const std::vector< std::string > &filter) const
bool passErsLimit(const Message &msg)
Gaudi::Property< unsigned int > m_statLevel
std::map< std::string, int, std::less<> > ThresholdMap
void i_reportMessage(const Message &msg, int outputLevel)
Internal implementation of reportMessage(const Message&,int) without lock.
virtual StatusCode stop() override
virtual void eraseStream(int, std::ostream *) override
std::thread m_thread
Thread for asynchronous reporting.
Gaudi::Property< std::string > m_defaultTimeFormat
Gaudi::Property< bool > m_stats
bool m_doSuppress
is suppression currently enabled?
void i_reportERS(const Message &msg) const
Report message to online messaging system (ERS)
virtual void eraseMessage(const StatusCode &) override
std::ostream * m_defaultStream
Pointer to the output stream.
std::map< size_t, unsigned int > m_msgHashCount
counts per message hash
Gaudi::Property< unsigned int > m_publishLevel
virtual StatusCode reinitialize() override
virtual void insertStream(int, std::string, std::ostream *) override
std::unordered_map< EventContext::ContextID_t, std::pair< EventContext::ContextEvt_t, MsgAry > > m_slotMsgCount
counts per slot and level
Define macros for attributes used to control the static checker.
virtual void reportMessage(const StatusCode &, std::string_view) override
Not supported by this implementation.
void setupLimits(Gaudi::Details::PropertyBase &prop)
std::array< Gaudi::Property< std::vector< std::string > >, MSG::NUM_LEVELS > m_useERS
Special properties to control output to ERS of individual sources.
virtual std::ostream *defaultStream ATLAS_NOT_CONST_THREAD_SAFE() const override
Gaudi::Property< bool > m_suppressRunningOnly
virtual void setDefaultStream(std::ostream *stream) override
virtual StatusCode start() override
Gaudi::Property< bool > m_suppress
virtual bool useColor() const override
virtual void eraseStream(std::ostream *) override
virtual StatusCode finalize() override
Gaudi::Property< bool > m_color