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