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  { END_THREAD // END
31  ,
33  ,
34  CONFIGURE // CFG -- handshaked
35  ,
36  EXTERN_DEST // EXT
37  ,
38  SUMMARIZE // SUM
39  ,
40  JOBMODE // MOD
41  ,
42  SHUT_UP // SHT
43  ,
44  FLUSH_LOG_Q // FLS -- handshaked
45  ,
46  GROUP_STATS // GRP
47  ,
48  FJR_SUMMARY // JRS -- handshaked
49  }; // OpCode
50 
51  // --- birth via a surrogate:
52  static MessageLoggerQ* instance();
53 
54  // --- post a message to the queue:
55  static void MLqEND();
56  static void MLqLOG(ErrorObj* p);
57  static void MLqCFG(ParameterSet* p);
58  static void MLqSUM();
59  static void MLqMOD(std::string* jm);
60  static void MLqSHT();
61  static void MLqFLS();
62  static void MLqGRP(std::string* cat_p);
63  static void MLqJRS(std::map<std::string, double>* sum_p);
64 
65  // --- bookkeeping for single-thread mode
66  static void setMLscribe_ptr(std::shared_ptr<edm::service::AbstractMLscribe> m);
67 
68  // --- helper for scribes
69  static bool handshaked(const OpCode& op);
70 
71  // --- special control of standAlone logging behavior
73  static void squelch(std::string const& category);
75 
76  private:
77  // --- traditional birth/death, but disallowed to users:
80 
81  // --- place an item onto the queue, or execute the command directly
82  static void simpleCommand(OpCode opcode, void* operand);
83  static void handshakedCommand(OpCode opcode, void* operand, std::string const& commandMnemonic);
84 
85  // --- data:
86  CMS_THREAD_SAFE static std::shared_ptr<edm::service::AbstractMLscribe> mlscribe_ptr;
88  CMS_THREAD_SAFE static std::set<std::string> squelchSet;
89 
90  }; // MessageLoggerQ
91 
92 } // namespace edm
93 
94 #endif // FWCore_MessageLogger_MessageLoggerQ_h
edm::MessageLoggerQ::squelchSet
static std::set< std::string > squelchSet
Definition: MessageLoggerQ.h:88
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:42
edm::MessageLoggerQ::EXTERN_DEST
Definition: MessageLoggerQ.h:36
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:44
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
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
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:34
edm::MessageLoggerQ::handshaked
static bool handshaked(const OpCode &op)
Definition: MessageLoggerQ.cc:186
edm::MessageLoggerQ::END_THREAD
Definition: MessageLoggerQ.h:30
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::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:46
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:47
edm::MessageLoggerQ::MLqGRP
static void MLqGRP(std::string *cat_p)
Definition: MessageLoggerQ.cc:177
ParameterSet
Definition: Functions.h:16
thread_safety_macros.h
edm::MessageLoggerQ::threshold
static edm::messagelogger::ELseverityLevel threshold
Definition: MessageLoggerQ.h:87
edm::MessageLoggerQ::FJR_SUMMARY
Definition: MessageLoggerQ.h:48
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:86
edm::MessageLoggerQ::LOG_A_MESSAGE
Definition: MessageLoggerQ.h:32
ErrorSummaryFilter_cfi.severity
severity
Definition: ErrorSummaryFilter_cfi.py:5
edm::MessageLoggerQ::JOBMODE
Definition: MessageLoggerQ.h:40
edm::MessageLoggerQ
Definition: MessageLoggerQ.h:23
edm::messagelogger::ELseverityLevel
Definition: ELseverityLevel.h:26
edm::MessageLoggerQ::SUMMARIZE
Definition: MessageLoggerQ.h:38
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