CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
73  static void standAloneThreshold(edm::messagelogger::ELseverityLevel const& severity);
74  static void squelch(std::string const& category);
75  static bool ignore(edm::messagelogger::ELseverityLevel const& severity, 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
void operator=(MessageLoggerQ const &)=delete
static bool handshaked(const OpCode &op)
static const char category[]
static void squelch(std::string const &category)
static void MLqCFG(ParameterSet *p)
static void MLqFLS()
static edm::messagelogger::ELseverityLevel threshold
#define CMS_THREAD_SAFE
static MessageLoggerQ * instance()
static bool ignore(edm::messagelogger::ELseverityLevel const &severity, std::string const &category)
static void MLqEND()
static void setMLscribe_ptr(std::shared_ptr< edm::service::AbstractMLscribe > m)
static void handshakedCommand(OpCode opcode, void *operand, std::string const &commandMnemonic)
static void MLqJRS(std::map< std::string, double > *sum_p)
static void standAloneThreshold(edm::messagelogger::ELseverityLevel const &severity)
static void MLqMOD(std::string *jm)
static void MLqGRP(std::string *cat_p)
static void MLqLOG(ErrorObj *p)
static std::set< std::string > squelchSet
static void MLqSUM()
static std::shared_ptr< edm::service::AbstractMLscribe > mlscribe_ptr
static void simpleCommand(OpCode opcode, void *operand)
static void MLqSHT()