CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 NamedDestination;
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 MLqEXT( service::NamedDestination* p );
50  static void MLqSUM();
51  static void MLqMOD( std::string * jm );
52  static void MLqSHT();
53  static void MLqFLS();
54  static void MLqGRP(std::string * cat_p);
55  static void MLqJRS(std::map<std::string, double> * sum_p);
56 
57  // --- bookkeeping for single-thread mode
58  static void setMLscribe_ptr
59  (std::shared_ptr<edm::service::AbstractMLscribe> m);
60 
61  // --- helper for scribes
62  static bool handshaked ( const OpCode & op );
63 
64  // --- special control of standAlone logging behavior
66  static void squelch(std::string const & category);
67  static bool ignore ( edm::ELseverityLevel const & severity,
68  std::string const & category );
69 
70 private:
71  // --- traditional birth/death, but disallowed to users:
74 
75  // --- place an item onto the queue, or execute the command directly
76  static void simpleCommand( OpCode opcode, void * operand );
77  static void handshakedCommand( OpCode opcode,
78  void * operand,
79  std::string const & commandMnemonic);
80 
81  // --- no copying:
82  MessageLoggerQ( MessageLoggerQ const & );
83  void operator = ( MessageLoggerQ const & );
84 
85  // --- data:
86  [[cms::thread_safe]] static std::shared_ptr<edm::service::AbstractMLscribe> mlscribe_ptr;
87  [[cms::thread_safe]] static edm::ELseverityLevel threshold;
88  [[cms::thread_safe]] static std::set<std::string> squelchSet;
89 
90 }; // MessageLoggerQ
91 
92 
93 } // namespace edm
94 
95 
96 #endif // FWCore_MessageLogger_MessageLoggerQ_h
static bool handshaked(const OpCode &op)
static void MLqEXT(service::NamedDestination *p)
static bool ignore(edm::ELseverityLevel const &severity, std::string const &category)
static void squelch(std::string const &category)
void operator=(MessageLoggerQ const &)
static void MLqCFG(ParameterSet *p)
static void MLqFLS()
static edm::ELseverityLevel threshold
static MessageLoggerQ * instance()
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 MLqMOD(std::string *jm)
static void MLqGRP(std::string *cat_p)
static void MLqLOG(ErrorObj *p)
static std::set< std::string > squelchSet
static void standAloneThreshold(edm::ELseverityLevel const &severity)
static void MLqSUM()
static std::shared_ptr< edm::service::AbstractMLscribe > mlscribe_ptr
static void simpleCommand(OpCode opcode, void *operand)
static void MLqSHT()