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  ,
29  LOG_A_MESSAGE // LOG
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
69  static void standAloneThreshold(edm::ELseverityLevel const& severity);
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:
76  ~MessageLoggerQ();
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
static PFTauRenderPlugin instance
static edm::ELseverityLevel threshold
#define CMS_THREAD_SAFE
def ignore(seq)
HLT enums.
static std::set< std::string > squelchSet
static std::shared_ptr< edm::service::AbstractMLscribe > mlscribe_ptr