CMS 3D CMS Logo

ELdestination.h
Go to the documentation of this file.
1 #ifndef FWCore_MessageService_ELdestination_h
2 #define FWCore_MessageService_ELdestination_h
3 
4 // ----------------------------------------------------------------------
5 //
6 // ELdestination is a virtual class defining the interface to a
7 // destination. Concrete classes derived from this include
8 // ELoutput and ELstatistics. The ELadministrator owns
9 // a list of ELdestination* as well as the objects those
10 // list elements point to.
11 //
12 // 7/5/98 mf Created file.
13 // 6/16/99 jvr Allows suppress/include options on destinations
14 // 7/1/99 mf Forward-declared ELdestControl for strict C++ (thanks cg).
15 // 7/2/99 jvr Added separate/attachTime, Epilogue, and Serial options
16 // 12/20/99 mf Added virtual destructor.
17 // 6/7/00 web Consolidated ELdestination/X; add filterModule()
18 // 6/14/00 web Declare classes before granting friendship.
19 // 10/4/00 mf Add excludeModule
20 // 1/15/01 mf setLineLength()
21 // 2/13/01 mf fix written by pc to accomodate NT problem with
22 // static init { $001$ }. Corresponding fix is in .cc file.
23 // 3/13/01 mf statisticsMap()
24 // 04/04/01 mf add ignoreMOdule and respondToModule
25 // 6/23/03 mf changeFile() and flush()
26 // 1/10/06 mf finish
27 // 6/19/08 mf summaryForJobReport()
28 //
29 // ----------------------------------------------------------------------
30 
32 
36 
37 #include <unordered_set>
38 #include <string>
39 
40 namespace edm {
41  namespace service {
42 
43  // ----------------------------------------------------------------------
44  // prerequisite classes:
45  // ----------------------------------------------------------------------
46 
47  class ELadministrator;
48 
49  // ----------------------------------------------------------------------
50  // ELdestination:
51  // ----------------------------------------------------------------------
52 
53  class ELdestination {
54  friend class ELadministrator;
55 
56  public:
57  ELdestination();
58  virtual ~ELdestination();
59 
60  // ----- Methods invoked by the ELadministrator:
61  //
62  public:
63  virtual bool log(const edm::ErrorObj& msg);
64 
65  virtual ELstring getNewline() const;
66 
67  virtual void finish();
68 
69  // ----- Behavior control methods invoked by the framework:
70  //
71  void setThreshold(const ELseverityLevel& sv);
73  void setLimit(const ELstring& s, int n);
74  void setLimit(const ELseverityLevel& sv, int n);
75  void setInterval(const ELstring& s, int interval);
76  void setInterval(const ELseverityLevel& sv, int interval);
77  void setTimespan(const ELstring& s, int n);
78  void setTimespan(const ELseverityLevel& sv, int n);
79 
80  // ----- Select output format options:
81  //
82  virtual void suppressText();
83  virtual void includeText(); // $$ jvr
84  virtual void suppressModule();
85  virtual void includeModule();
86  virtual void suppressSubroutine();
87  virtual void includeSubroutine();
88  virtual void suppressTime();
89  virtual void includeTime();
90  virtual void suppressContext();
91  virtual void includeContext();
92  virtual void suppressSerial();
93  virtual void includeSerial();
94  virtual void useFullContext();
95  virtual void useContext();
96  virtual void separateTime();
97  virtual void attachTime();
98  virtual void separateEpilogue();
99  virtual void attachEpilogue();
100  virtual int setLineLength(int len);
101  virtual int getLineLength() const;
102 
103  virtual void wipe();
104  virtual void zero();
105  virtual void filterModule(ELstring const& moduleName);
106  virtual void excludeModule(ELstring const& moduleName);
107  virtual void ignoreModule(ELstring const& moduleName);
108  virtual void respondToModule(ELstring const& moduleName);
109  virtual bool thisShouldBeIgnored(const ELstring& s) const;
110 
111  virtual void setTableLimit(int n);
112 
113  virtual void changeFile(std::ostream& os);
114  virtual void changeFile(const ELstring& filename);
115  virtual void flush();
116 
117  protected:
126  std::unordered_set<std::string> respondToThese;
128  std::unordered_set<std::string> ignoreThese;
129  // Fix $001 2/13/01 mf
130 #ifndef DEFECT_NO_STATIC_CONST_INIT
131  static const int defaultLineLength = 80;
132 #else
133  static const int defaultLineLength;
134 #endif
135 
136  // ----- Verboten methods:
137  //
138  private:
139  ELdestination(const ELdestination& orig) = delete;
140  ELdestination& operator=(const ELdestination& orig) = delete;
141 
142  }; // ELdestination
143 
145  void operator()(std::ostream* os) const;
146  };
147 
148  } // end of namespace service
149 } // end of namespace edm
150 
151 #endif // FWCore_MessageService_ELdestination_h
ELseverityLevel traceThreshold
virtual void excludeModule(ELstring const &moduleName)
std::unordered_set< std::string > ignoreThese
void setTimespan(const ELstring &s, int n)
virtual void includeSubroutine()
virtual bool thisShouldBeIgnored(const ELstring &s) const
virtual int setLineLength(int len)
static const int defaultLineLength
virtual int getLineLength() const
virtual void ignoreModule(ELstring const &moduleName)
std::string moduleName(Provenance const &provenance)
Definition: Provenance.cc:27
void setThreshold(const ELseverityLevel &sv)
ELdestination & operator=(const ELdestination &orig)=delete
virtual void filterModule(ELstring const &moduleName)
std::unordered_set< std::string > respondToThese
void setTraceThreshold(const ELseverityLevel &sv)
virtual void suppressSubroutine()
virtual void changeFile(std::ostream &os)
tuple msg
Definition: mps_check.py:279
virtual void respondToModule(ELstring const &moduleName)
HLT enums.
virtual ELstring getNewline() const
virtual bool log(const edm::ErrorObj &msg)
virtual void setTableLimit(int n)
void setInterval(const ELstring &s, int interval)
std::string ELstring
Definition: ELstring.h:21
void setLimit(const ELstring &s, int n)