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