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  // --- enumerate types of messages that can be enqueued:
26  enum OpCode // abbrev's used hereinafter
27  { END_THREAD // END
28  ,
30  ,
31  CONFIGURE // CFG -- handshaked
32  ,
33  EXTERN_DEST // EXT
34  ,
35  SUMMARIZE // SUM
36  ,
37  JOBMODE // MOD
38  ,
39  SHUT_UP // SHT
40  ,
41  FLUSH_LOG_Q // FLS -- handshaked
42  ,
43  GROUP_STATS // GRP
44  ,
45  FJR_SUMMARY // JRS -- handshaked
46  }; // OpCode
47 
48  // --- birth via a surrogate:
49  static MessageLoggerQ* instance();
50 
51  // --- post a message to the queue:
52  static void MLqEND();
53  static void MLqLOG(ErrorObj* p);
54  static void MLqCFG(ParameterSet* p);
55  static void MLqSUM();
56  static void MLqMOD(std::string* jm);
57  static void MLqSHT();
58  static void MLqFLS();
59  static void MLqGRP(std::string* cat_p);
60  static void MLqJRS(std::map<std::string, double>* sum_p);
61 
62  // --- bookkeeping for single-thread mode
63  static void setMLscribe_ptr(std::shared_ptr<edm::service::AbstractMLscribe> m);
64 
65  // --- helper for scribes
66  static bool handshaked(const OpCode& op);
67 
68  // --- special control of standAlone logging behavior
70  static void squelch(std::string const& category);
71  static bool ignore(edm::ELseverityLevel const& severity, std::string const& category);
72 
73  private:
74  // --- traditional birth/death, but disallowed to users:
77 
78  // --- place an item onto the queue, or execute the command directly
79  static void simpleCommand(OpCode opcode, void* operand);
80  static void handshakedCommand(OpCode opcode, void* operand, std::string const& commandMnemonic);
81 
82  // --- no copying:
83  MessageLoggerQ(MessageLoggerQ const&) = delete;
84  void operator=(MessageLoggerQ const&) = delete;
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::MLqCFG
static void MLqCFG(ParameterSet *p)
Definition: MessageLoggerQ.cc:160
taus_updatedMVAIds_cff.category
category
Definition: taus_updatedMVAIds_cff.py:30
service
Definition: service.py:1
edm::MessageLoggerQ::SHUT_UP
Definition: MessageLoggerQ.h:39
edm::MessageLoggerQ::EXTERN_DEST
Definition: MessageLoggerQ.h:33
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:41
edm::MessageLoggerQ::handshakedCommand
static void handshakedCommand(OpCode opcode, void *operand, std::string const &commandMnemonic)
Definition: MessageLoggerQ.cc:138
edm::MessageLoggerQ::ignore
static bool ignore(edm::ELseverityLevel const &severity, std::string const &category)
Definition: MessageLoggerQ.cc:196
edm
HLT enums.
Definition: AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::ErrorObj
Definition: ErrorObj.h:44
edm::MessageLoggerQ::MLqLOG
static void MLqLOG(ErrorObj *p)
Definition: MessageLoggerQ.cc:156
edm::MessageLoggerQ::CONFIGURE
Definition: MessageLoggerQ.h:31
edm::MessageLoggerQ::handshaked
static bool handshaked(const OpCode &op)
Definition: MessageLoggerQ.cc:186
edm::MessageLoggerQ::END_THREAD
Definition: MessageLoggerQ.h:27
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
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::MLqFLS
static void MLqFLS()
Definition: MessageLoggerQ.cc:168
edm::MessageLoggerQ::GROUP_STATS
Definition: MessageLoggerQ.h:43
CMS_THREAD_SAFE
#define CMS_THREAD_SAFE
Definition: thread_safety_macros.h:4
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:36
edm::MessageLoggerQ::MLqGRP
static void MLqGRP(std::string *cat_p)
Definition: MessageLoggerQ.cc:177
ParameterSet
Definition: Functions.h:16
thread_safety_macros.h
HLT_2018_cff.severity
severity
Definition: HLT_2018_cff.py:48631
edm::MessageLoggerQ::standAloneThreshold
static void standAloneThreshold(edm::ELseverityLevel const &severity)
Definition: MessageLoggerQ.cc:194
edm::MessageLoggerQ::FJR_SUMMARY
Definition: MessageLoggerQ.h:45
ELseverityLevel.h
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::ELseverityLevel
Definition: ELseverityLevel.h:96
edm::MessageLoggerQ::LOG_A_MESSAGE
Definition: MessageLoggerQ.h:29
edm::MessageLoggerQ::JOBMODE
Definition: MessageLoggerQ.h:37
edm::MessageLoggerQ
Definition: MessageLoggerQ.h:23
edm::MessageLoggerQ::SUMMARIZE
Definition: MessageLoggerQ.h:35
edm::MessageLoggerQ::operator=
void operator=(MessageLoggerQ const &)=delete
edm::MessageLoggerQ::MLqEND
static void MLqEND()
Definition: MessageLoggerQ.cc:152
edm::MessageLoggerQ::threshold
static edm::ELseverityLevel threshold
Definition: MessageLoggerQ.h:88
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:26