test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ELdestControl.h
Go to the documentation of this file.
1 #ifndef FWCore_MessageService_ELdestControl_h
2 #define FWCore_MessageService_ELdestControl_h
3 
4 
5 // ----------------------------------------------------------------------
6 //
7 // ELdestControl is a handle class whose purpose is to dispatch orders
8 // from the framework to an ELdestination, without
9 // allowing the framework to destruct that instance of the
10 // destination (which would be a disasterous way to foul up).
11 // The ELadministrator creates an ELdestControl handle
12 // to its own copy whenever an ELdestination is attached.
13 //
14 // 7/5/98 mf Created file.
15 // 6/16/99 jvr Allows suppress/include options on destinations
16 // 7/2/99 jvr Added separate/attachTime, Epilogue, and Serial options
17 // 6/7/00 web Reflect consolidation of ELdestination/X; add
18 // filterModule()
19 // 10/04/00 mf add excludeModule()
20 // 01/15/00 mf mods to give user control of line length
21 // 03/13/01 mf mod to give user control of hex trigger and
22 // statisticsMap() method
23 // 04/04/01 mf add ignoreMOdule and respondToModule
24 // 10/17/01 mf add setTableLimit which had been omitted
25 // 10/18/01 mf Corrected default in summary title =0 to empty string
26 // 6/23/03 mf changeFile() and flush()
27 // 6/19/08 mf summaryForJobReport()
28 //
29 // ----------------------------------------------------------------------
30 
31 
36 
37 #include <memory>
38 
39 
40 namespace edm {
41 namespace service {
42 
43 // ----------------------------------------------------------------------
44 // prerequisite classes:
45 // ----------------------------------------------------------------------
46 
47 class ELdestination;
48 
49 // ----------------------------------------------------------------------
50 // ELdestControl:
51 // ----------------------------------------------------------------------
52 
54 
55 public:
56  ELdestControl( std::shared_ptr<ELdestination> dest );
57  ELdestControl();
59 
60  // ----- Behavior control methods invoked by the framework:
61  //
64  ELdestControl & setLimit( const ELstring & s, int n );
65  ELdestControl & setLimit( const ELseverityLevel & sv, int n );
66  ELdestControl & setInterval( const ELstring & s, int interval );
67  ELdestControl & setInterval( const ELseverityLevel& sv, int interval);
68  ELdestControl & setTimespan( const ELstring& s, int n );
69  ELdestControl & setTimespan( const ELseverityLevel & sv, int n );
70 
71  ELdestControl & setTableLimit( int n );
72 
73  // ----- Select output format options:
74  //
75  void suppressText(); void includeText(); // $$ jvr
76  void suppressModule(); void includeModule();
78  void suppressTime(); void includeTime();
79  void suppressContext(); void includeContext();
80  void suppressSerial(); void includeSerial();
81  void useFullContext(); void useContext();
82  void separateTime(); void attachTime();
83  void separateEpilogue(); void attachEpilogue();
84  void noTerminationSummary();
85  int setLineLength(int len); int getLineLength() const;
86 
87  void filterModule ( ELstring const & moduleName );
88  void excludeModule ( ELstring const & moduleName );
89  void respondToModule ( ELstring const & moduleName );
90  void ignoreModule ( ELstring const & moduleName );
91 
93  ELdestControl & wipe();
94  ELdestControl & zero();
95 
96  ELdestControl & setPreamble( const ELstring & preamble );
97  ELdestControl & setNewline( const ELstring & newline );
98 
99  // ----- Active methods invoked by the framework:
100  //
101  void summary( ELdestControl & dest, const char * title="" );
102  void summary( std::ostream & os , const char * title="" );
103  void summary( ELstring & s , const char * title="" );
104  void summary( );
105  void summaryForJobReport( std::map<std::string, double> & sm);
106 
107  std::map<ELextendedID , StatsCount> statisticsMap() const;
108 
109  bool log( edm::ErrorObj & msg ); // Backdoor to log a formed message
110  // to only this destination.
111 
112  void changeFile (std::ostream & os);
113  void changeFile (const ELstring & filename);
114  void flush();
115 
116  // ----- Helper methods invoked by other ErrorLogger classes
117 
118  void summarization( const ELstring & title
119  , const ELstring & sumLines
120  );
121 
122  ELstring getNewline() const;
123 
124  // ----- Data implementing the trivial handle pattern:
125  //
126 private:
127  std::shared_ptr<ELdestination> d;
128 
129 }; // ELdestControl
130 
131 
132 // ----------------------------------------------------------------------
133 
134 
135 } // end of namespace service
136 } // end of namespace edm
137 
138 
139 #endif // FWCore_MessageService_ELdestControl_h
std::shared_ptr< ELdestination > d
ELdestControl & setLimit(const ELstring &s, int n)
ELstring getNewline() const
ELdestControl & setThreshold(const ELseverityLevel &sv)
tuple interval
Definition: MergeJob_cfg.py:20
void changeFile(std::ostream &os)
bool log(edm::ErrorObj &msg)
ELdestControl & setTimespan(const ELstring &s, int n)
ELdestControl & setTraceThreshold(const ELseverityLevel &sv)
void ignoreModule(ELstring const &moduleName)
std::string moduleName(Provenance const &provenance)
Definition: Provenance.cc:27
void respondToModule(ELstring const &moduleName)
ELdestControl & setPreamble(const ELstring &preamble)
void filterModule(ELstring const &moduleName)
ELdestControl & clearSummary()
std::map< ELextendedID, StatsCount > statisticsMap() const
void summaryForJobReport(std::map< std::string, double > &sm)
ELdestControl & setNewline(const ELstring &newline)
void excludeModule(ELstring const &moduleName)
ELdestControl & setTableLimit(int n)
ELdestControl & setInterval(const ELstring &s, int interval)
tuple filename
Definition: lut2db_cfg.py:20
void summarization(const ELstring &title, const ELstring &sumLines)
std::string ELstring
Definition: ELstring.h:26