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 "boost/shared_ptr.hpp"
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  , JOBREPORT // JOB
36  , JOBMODE // MOD
37  , SHUT_UP // SHT
38  , FLUSH_LOG_Q // FLS -- handshaked
39  , GROUP_STATS // GRP
40  , FJR_SUMMARY // JRS -- handshaked
41  }; // OpCode
42 
43  // --- birth via a surrogate:
44  static MessageLoggerQ * instance();
45 
46  // --- post a message to the queue:
47  static void MLqEND();
48  static void MLqLOG( ErrorObj * p );
49  static void MLqCFG( ParameterSet * p );
50  static void MLqEXT( service::NamedDestination* p );
51  static void MLqSUM();
52  static void MLqJOB( std::string * j );
53  static void MLqMOD( std::string * jm );
54  static void MLqSHT();
55  static void MLqFLS();
56  static void MLqGRP(std::string * cat_p);
57  static void MLqJRS(std::map<std::string, double> * sum_p);
58 
59  // --- bookkeeping for single-thread mode
60  static void setMLscribe_ptr
61  (boost::shared_ptr<edm::service::AbstractMLscribe> m);
62 
63  // --- helper for scribes
64  static bool handshaked ( const OpCode & op );
65 
66  // --- special control of standAlone logging behavior
67  static void standAloneThreshold(std::string const & severity);
68  static void squelch(std::string const & category);
69  static bool ignore ( edm::ELseverityLevel const & severity,
70  std::string const & category );
71 
72 private:
73  // --- traditional birth/death, but disallowed to users:
76 
77  // --- place an item onto the queue, or execute the command directly
78  static void simpleCommand( OpCode opcode, void * operand );
79  static void handshakedCommand( OpCode opcode,
80  void * operand,
81  std::string const & commandMnemonic);
82 
83  // --- no copying:
84  MessageLoggerQ( MessageLoggerQ const & );
85  void operator = ( MessageLoggerQ const & );
86 
87  // --- data:
88  static boost::shared_ptr<edm::service::AbstractMLscribe> mlscribe_ptr;
90  static std::set<std::string> squelchSet;
91 
92 }; // MessageLoggerQ
93 
94 
95 } // namespace edm
96 
97 
98 #endif // FWCore_MessageLogger_MessageLoggerQ_h
static void setMLscribe_ptr(boost::shared_ptr< edm::service::AbstractMLscribe > m)
static bool handshaked(const OpCode &op)
static void MLqEXT(service::NamedDestination *p)
static void standAloneThreshold(std::string const &severity)
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
int j
Definition: DBlmapReader.cc:9
static MessageLoggerQ * instance()
static void MLqEND()
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 boost::shared_ptr< edm::service::AbstractMLscribe > mlscribe_ptr
static std::set< std::string > squelchSet
static void MLqJOB(std::string *j)
static void MLqSUM()
static void simpleCommand(OpCode opcode, void *operand)
static void MLqSHT()