CMS 3D CMS Logo

MessageLoggerQ.h
Go to the documentation of this file.
1 #ifndef FWCore_MessageLogger_MessageLoggerQ_h
2 #define FWCore_MessageLogger_MessageLoggerQ_h
3 
6 
7 #include <memory>
8 
9 #include <string>
10 #include <map>
11 #include <set>
12 
13 namespace edm {
14 
15  // --- forward declarations:
16  class ErrorObj;
17  class ParameterSet;
18  class ELdestination;
19  namespace service {
20  class AbstractMLscribe;
21  }
22 
24  public:
25  MessageLoggerQ(MessageLoggerQ const&) = delete;
26  void operator=(MessageLoggerQ const&) = delete;
27 
28  // --- enumerate types of messages that can be enqueued:
29  enum OpCode // abbrev's used hereinafter
30  {
31  END_THREAD // END
32  ,
34  ,
35  CONFIGURE // CFG -- handshaked
36  ,
37  EXTERN_DEST // EXT
38  ,
39  SUMMARIZE // SUM
40  ,
41  JOBMODE // MOD
42  ,
43  SHUT_UP // SHT
44  ,
45  FLUSH_LOG_Q // FLS -- handshaked
46  ,
47  GROUP_STATS // GRP
48  ,
49  FJR_SUMMARY // JRS -- handshaked
50  }; // OpCode
51 
52  // --- birth via a surrogate:
53  static MessageLoggerQ* instance();
54 
55  // --- post a message to the queue:
56  static void MLqEND();
57  static void MLqLOG(ErrorObj* p);
58  static void MLqCFG(ParameterSet* p);
59  static void MLqSUM();
60  static void MLqMOD(std::string* jm);
61  static void MLqSHT();
62  static void MLqFLS();
63  static void MLqGRP(std::string* cat_p);
64  static void MLqJRS(std::map<std::string, double>* sum_p);
65 
66  // --- bookkeeping for single-thread mode
67  static void setMLscribe_ptr(std::shared_ptr<edm::service::AbstractMLscribe> m);
68 
69  // --- helper for scribes
70  static bool handshaked(const OpCode& op);
71 
72  // --- special control of standAlone logging behavior
74  static void squelch(std::string const& category);
76 
77  private:
78  // --- traditional birth/death, but disallowed to users:
81 
82  // --- place an item onto the queue, or execute the command directly
83  static void simpleCommand(OpCode opcode, void* operand);
84  static void handshakedCommand(OpCode opcode, void* operand, std::string const& commandMnemonic);
85 
86  // --- data:
87  CMS_THREAD_SAFE static std::shared_ptr<edm::service::AbstractMLscribe> mlscribe_ptr;
89  CMS_THREAD_SAFE static std::set<std::string> squelchSet;
90 
91  }; // MessageLoggerQ
92 
93 } // namespace edm
94 
95 #endif // FWCore_MessageLogger_MessageLoggerQ_h
edm::MessageLoggerQ::squelchSet
static std::set< std::string > squelchSet
Definition: MessageLoggerQ.h:89
edm::MessageLoggerQ::ignore
static bool ignore(edm::messagelogger::ELseverityLevel const &severity, std::string const &category)
Definition: MessageLoggerQ.cc:196
edm::MessageLoggerQ::MLqCFG
static void MLqCFG(ParameterSet *p)
Definition: MessageLoggerQ.cc:160
taus_updatedMVAIds_cff.category
category
Definition: taus_updatedMVAIds_cff.py:31
service
Definition: service.py:1
edm::MessageLoggerQ::SHUT_UP
Definition: MessageLoggerQ.h:43
edm::MessageLoggerQ::EXTERN_DEST
Definition: MessageLoggerQ.h:37
edm::MessageLoggerQ::instance
static MessageLoggerQ * instance()
Definition: MessageLoggerQ.cc:119
edm::MessageLoggerQ::squelch
static void squelch(std::string const &category)
Definition: MessageLoggerQ.cc:195
edm::MessageLoggerQ::MLqSUM
static void MLqSUM()
Definition: MessageLoggerQ.cc:162
edm::MessageLoggerQ::FLUSH_LOG_Q
Definition: MessageLoggerQ.h:45
edm::MessageLoggerQ::handshakedCommand
static void handshakedCommand(OpCode opcode, void *operand, std::string const &commandMnemonic)
Definition: MessageLoggerQ.cc:138
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ErrorObj
Definition: ErrorObj.h:43
ELseverityLevel.h
edm::MessageLoggerQ::MLqLOG
static void MLqLOG(ErrorObj *p)
Definition: MessageLoggerQ.cc:156
edm::MessageLoggerQ::CONFIGURE
Definition: MessageLoggerQ.h:35
edm::MessageLoggerQ::handshaked
static bool handshaked(const OpCode &op)
Definition: MessageLoggerQ.cc:186
edm::MessageLoggerQ::END_THREAD
Definition: MessageLoggerQ.h:31
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:79
edm::MessageLoggerQ::setMLscribe_ptr
static void setMLscribe_ptr(std::shared_ptr< edm::service::AbstractMLscribe > m)
Definition: MessageLoggerQ.cc:124
edm::MessageLoggerQ::MLqSHT
static void MLqSHT()
Definition: MessageLoggerQ.cc:154
edm::MessageLoggerQ::MessageLoggerQ
MessageLoggerQ()
Definition: MessageLoggerQ.cc:115
edm::MessageLoggerQ::standAloneThreshold
static void standAloneThreshold(edm::messagelogger::ELseverityLevel const &severity)
Definition: MessageLoggerQ.cc:194
edm::MessageLoggerQ::MLqFLS
static void MLqFLS()
Definition: MessageLoggerQ.cc:168
edm::MessageLoggerQ::GROUP_STATS
Definition: MessageLoggerQ.h:47
CMS_THREAD_SAFE
#define CMS_THREAD_SAFE
Definition: thread_safety_macros.h:4
edm::ParameterSet
Definition: ParameterSet.h:47
edm::MessageLoggerQ::MLqGRP
static void MLqGRP(std::string *cat_p)
Definition: MessageLoggerQ.cc:177
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
ParameterSet
Definition: Functions.h:16
thread_safety_macros.h
edm::MessageLoggerQ::threshold
static edm::messagelogger::ELseverityLevel threshold
Definition: MessageLoggerQ.h:88
edm::MessageLoggerQ::FJR_SUMMARY
Definition: MessageLoggerQ.h:49
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::MessageLoggerQ::MLqMOD
static void MLqMOD(std::string *jm)
Definition: MessageLoggerQ.cc:164
edm::MessageLoggerQ::mlscribe_ptr
static std::shared_ptr< edm::service::AbstractMLscribe > mlscribe_ptr
Definition: MessageLoggerQ.h:87
edm::MessageLoggerQ::LOG_A_MESSAGE
Definition: MessageLoggerQ.h:33
ErrorSummaryFilter_cfi.severity
severity
Definition: ErrorSummaryFilter_cfi.py:5
edm::MessageLoggerQ::JOBMODE
Definition: MessageLoggerQ.h:41
edm::MessageLoggerQ
Definition: MessageLoggerQ.h:23
edm::messagelogger::ELseverityLevel
Definition: ELseverityLevel.h:26
edm::MessageLoggerQ::SUMMARIZE
Definition: MessageLoggerQ.h:39
edm::MessageLoggerQ::operator=
void operator=(MessageLoggerQ const &)=delete
edm::MessageLoggerQ::MLqEND
static void MLqEND()
Definition: MessageLoggerQ.cc:152
edm::MessageLoggerQ::~MessageLoggerQ
~MessageLoggerQ()
Definition: MessageLoggerQ.cc:117
edm::MessageLoggerQ::simpleCommand
static void simpleCommand(OpCode opcode, void *operand)
Definition: MessageLoggerQ.cc:133
edm::MessageLoggerQ::MLqJRS
static void MLqJRS(std::map< std::string, double > *sum_p)
Definition: MessageLoggerQ.cc:182
edm::MessageLoggerQ::OpCode
OpCode
Definition: MessageLoggerQ.h:29