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 
5 
6 #include <memory>
7 
8 #include <string>
9 #include <map>
10 #include <set>
11 
12 namespace edm
13 {
14 
15 // --- forward declarations:
16 class ErrorObj;
17 class ParameterSet;
18 class ELdestination;
19 namespace service {
20 class AbstractMLscribe;
21 }
22 
23 
25 {
26 public:
27  // --- enumerate types of messages that can be enqueued:
28  enum OpCode // abbrev's used hereinafter
29  { END_THREAD // END
30  , LOG_A_MESSAGE // LOG
31  , CONFIGURE // CFG -- handshaked
32  , EXTERN_DEST // EXT
33  , SUMMARIZE // SUM
34  , JOBMODE // MOD
35  , SHUT_UP // SHT
36  , FLUSH_LOG_Q // FLS -- handshaked
37  , GROUP_STATS // GRP
38  , FJR_SUMMARY // JRS -- handshaked
39  }; // OpCode
40 
41  // --- birth via a surrogate:
42  static MessageLoggerQ * instance();
43 
44  // --- post a message to the queue:
45  static void MLqEND();
46  static void MLqLOG( ErrorObj * p );
47  static void MLqCFG( ParameterSet * p );
48  static void MLqSUM();
49  static void MLqMOD( std::string * jm );
50  static void MLqSHT();
51  static void MLqFLS();
52  static void MLqGRP(std::string * cat_p);
53  static void MLqJRS(std::map<std::string, double> * sum_p);
54 
55  // --- bookkeeping for single-thread mode
56  static void setMLscribe_ptr
57  (std::shared_ptr<edm::service::AbstractMLscribe> m);
58 
59  // --- helper for scribes
60  static bool handshaked ( const OpCode & op );
61 
62  // --- special control of standAlone logging behavior
63  static void standAloneThreshold(edm::ELseverityLevel const& severity);
64  static void squelch(std::string const & category);
65  static bool ignore ( edm::ELseverityLevel const & severity,
66  std::string const & category );
67 
68 private:
69  // --- traditional birth/death, but disallowed to users:
71  ~MessageLoggerQ();
72 
73  // --- place an item onto the queue, or execute the command directly
74  static void simpleCommand( OpCode opcode, void * operand );
75  static void handshakedCommand( OpCode opcode,
76  void * operand,
77  std::string const & commandMnemonic);
78 
79  // --- no copying:
80  MessageLoggerQ( MessageLoggerQ const & );
81  void operator = ( MessageLoggerQ const & );
82 
83  // --- data:
84  [[cms::thread_safe]] static std::shared_ptr<edm::service::AbstractMLscribe> mlscribe_ptr;
85  [[cms::thread_safe]] static edm::ELseverityLevel threshold;
86  [[cms::thread_safe]] static std::set<std::string> squelchSet;
87 
88 }; // MessageLoggerQ
89 
90 
91 } // namespace edm
92 
93 
94 #endif // FWCore_MessageLogger_MessageLoggerQ_h
static PFTauRenderPlugin instance
static edm::ELseverityLevel threshold
def ignore(seq)
HLT enums.
static std::set< std::string > squelchSet
static std::shared_ptr< edm::service::AbstractMLscribe > mlscribe_ptr