CMS 3D CMS Logo

ELdestination.cc
Go to the documentation of this file.
1 // ----------------------------------------------------------------------
2 //
3 // ELdestination.cc
4 //
5 // History:
6 //
7 // 7/5/98 mf Created
8 // 6/16/99 jvr Allow suppress/include options on destinations
9 // 7/2/99 jvr Added separate/attachTime, Epilogue, and Serial
10 // options
11 // 6/7/00 web Consolidate ELdestination/X; add filterModule()
12 // 8/22/00 web Fix omitted .getSymbol() call
13 // 10/4/00 mf excludeModule()
14 // 1/15/01 mf setLineLength()
15 // 2/13/01 mf fix written by pc to accomodate NT problem with
16 // static init { $001$ }. Corresponding fix is in
17 // .h file.
18 // 3/13/01 mf statisticsMap()
19 // 4/05/01 mf multi-module filtering
20 // 4/12/01 mf repair multi-module filtering
21 // 6/23/03 mf changeFile(), flush()
22 // 1/10/06 mf finish()
23 // 6/19/08 mf summaryForJobReport()
24 //
25 // ----------------------------------------------------------------------
26 
27 #include <iostream>
28 #include <fstream>
29 
31 
32 // Possible Traces:
33 // #define ELdestinationCONSTRUCTOR_TRACE
34 
35 namespace edm {
36  namespace service {
37  // Fix $001 2/13/01 mf
38 #ifdef DEFECT_NO_STATIC_CONST_INIT
39  const int ELdestination::defaultLineLength = 80;
40 #endif
41 
44  traceThreshold(ELhighestSeverity),
45  limits(),
46  preamble("%MSG"),
47  newline("\n"),
48  indent(" "),
49  lineLength(defaultLineLength),
50  ignoreMostModules(false),
51  respondToThese(),
52  respondToMostModules(false),
53  ignoreThese() {
54 #ifdef ELdestinationCONSTRUCTOR_TRACE
55  std::cerr << "Constructor for ELdestination\n";
56 #endif
57 
58  } // ELdestination()
59 
61 #ifdef ELdestinationCONSTRUCTOR_TRACE
62  std::cerr << "Destructor for ELdestination\n";
63 #endif
64 
65  } // ~ELdestination()
66 
67  // ----------------------------------------------------------------------
68  // Methods invoked by the ELadministrator:
69  // ----------------------------------------------------------------------
70 
71  bool ELdestination::log(const edm::ErrorObj&) { return false; }
72 
73  // ----------------------------------------------------------------------
74  // Methods invoked through the ELdestControl handle:
75  // ----------------------------------------------------------------------
76 
77  // Each of these must be overridden by any destination for which they make
78  // sense. In this base class, where they are all no-ops, the methods which
79  // generate data to a destination, stream or stream will warn at that place,
80  // and all the no-op methods will issue an ELwarning2 at their own destination.
81 
82  static const ELstring hereMsg = "available via this destination";
83  static const ELstring noosMsg = "No ostream";
84  static const ELstring notELoutputMsg = "This destination is not an ELoutput";
85 
86  // ----------------------------------------------------------------------
87  // Behavior control methods invoked by the framework
88  // ----------------------------------------------------------------------
89 
91 
93 
94  void ELdestination::setLimit(const ELstring& s, int n) { limits.setLimit(s, n); }
95 
97 
99 
101 
103 
105 
107 
109 
111  if (moduleName == "*") {
112  ignoreMostModules = false;
113  respondToMostModules = true;
114  ignoreThese.clear();
115  respondToThese.clear();
116  } else {
117  respondToThese.insert(moduleName);
118  ignoreThese.erase(moduleName);
119  }
120  }
121 
123  if (moduleName == "*") {
124  respondToMostModules = false;
125  ignoreMostModules = true;
126  respondToThese.clear();
127  ignoreThese.clear();
128  } else {
129  ignoreThese.insert(moduleName);
130  respondToThese.erase(moduleName);
131  }
132  }
133 
135  ignoreModule("*");
137  }
138 
140  respondToModule("*");
142  }
143 
145 
147 
148  void ELdestination::changeFile(std::ostream& /*unused*/) {
150  msg << notELoutputMsg;
151  log(msg);
152  }
153 
156  msg << notELoutputMsg << newline << "file requested is" << filename;
157  log(msg);
158  }
159 
162  msg << "cannot flush()";
163  log(msg);
164  }
165 
166  // ----------------------------------------------------------------------
167  // Output format options:
168  // ----------------------------------------------------------------------
169 
170  void ELdestination::suppressText() { ; } // $$ jvr
172 
175 
178 
181 
184 
187 
190 
193 
196 
198 
200  int temp = lineLength;
201  lineLength = len;
202  return temp;
203  }
204 
205  int ELdestination::getLineLength() const { return lineLength; }
206 
207  // ----------------------------------------------------------------------
208  // Protected helper methods:
209  // ----------------------------------------------------------------------
210 
212  if (respondToMostModules) {
213  return (ignoreThese.find(s) != ignoreThese.end());
214  } else if (ignoreMostModules) {
215  return (respondToThese.find(s) == respondToThese.end());
216  } else {
217  return false;
218  }
219  }
220 
221  void close_and_delete::operator()(std::ostream* os) const {
222  std::ofstream* p = static_cast<std::ofstream*>(os);
223  p->close();
224  delete os;
225  }
226 
227  } // end of namespace service
228 } // end of namespace edm
edm::service::ELdestination::getNewline
virtual ELstring getNewline() const
Definition: ELdestination.cc:197
service
Definition: service.py:1
edm::service::ELdestination::ignoreModule
virtual void ignoreModule(ELstring const &moduleName)
Definition: ELdestination.cc:122
edm::service::ELdestination::setInterval
void setInterval(const ELstring &s, int interval)
Definition: ELdestination.cc:98
edm::service::hereMsg
static const ELstring hereMsg
Definition: ELdestination.cc:82
edm::service::ELdestination::suppressContext
virtual void suppressContext()
Definition: ELdestination.cc:182
edm::service::ELdestination::flush
virtual void flush()
Definition: ELdestination.cc:160
edm::service::ELdestination::suppressModule
virtual void suppressModule()
Definition: ELdestination.cc:173
edm::ELwarning
const ELslProxy< ELwarningGen > ELwarning
Definition: ELseverityLevel.cc:302
funct::false
false
Definition: Factorize.h:34
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
edm::service::notELoutputMsg
static const ELstring notELoutputMsg
Definition: ELdestination.cc:84
edm::service::ELdestination::suppressText
virtual void suppressText()
Definition: ELdestination.cc:170
edm::service::ELdestination::respondToModule
virtual void respondToModule(ELstring const &moduleName)
Definition: ELdestination.cc:110
edm::ELzeroSeverity
const ELslProxy< ELzeroSeverityGen > ELzeroSeverity
Definition: ELseverityLevel.cc:284
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::service::ELdestination::respondToThese
std::unordered_set< std::string > respondToThese
Definition: ELdestination.h:126
edm::service::ELdestination::traceThreshold
ELseverityLevel traceThreshold
Definition: ELdestination.h:119
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::ErrorObj
Definition: ErrorObj.h:44
edm::service::ELlimitsTable::setTimespan
void setTimespan(const ELstring &id, int n)
Definition: ELlimitsTable.cc:216
edm::service::ELdestination::suppressSubroutine
virtual void suppressSubroutine()
Definition: ELdestination.cc:176
edm::service::ELdestination::setThreshold
void setThreshold(const ELseverityLevel &sv)
Definition: ELdestination.cc:90
edm::service::ELdestination::changeFile
virtual void changeFile(std::ostream &os)
Definition: ELdestination.cc:148
edm::service::ELdestination::zero
virtual void zero()
Definition: ELdestination.cc:108
mps_check.msg
tuple msg
Definition: mps_check.py:285
edm::service::ELdestination::lineLength
int lineLength
Definition: ELdestination.h:124
edm::service::ELdestination::filterModule
virtual void filterModule(ELstring const &moduleName)
Definition: ELdestination.cc:134
edm::service::ELdestination::useContext
virtual void useContext()
Definition: ELdestination.cc:189
edm::service::ELdestination::useFullContext
virtual void useFullContext()
Definition: ELdestination.cc:188
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
edm::service::ELlimitsTable::setLimit
void setLimit(const ELstring &id, int n)
Definition: ELlimitsTable.cc:196
edm::service::ELdestination::includeSerial
virtual void includeSerial()
Definition: ELdestination.cc:186
edm::service::ELlimitsTable::wipe
void wipe()
Definition: ELlimitsTable.cc:165
edm::service::ELdestination::newline
ELstring newline
Definition: ELdestination.h:122
edm::service::ELdestination::separateTime
virtual void separateTime()
Definition: ELdestination.cc:191
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edm::ELstring
std::string ELstring
Definition: ELstring.h:21
edm::service::ELdestination::thisShouldBeIgnored
virtual bool thisShouldBeIgnored(const ELstring &s) const
Definition: ELdestination.cc:211
edm::service::ELdestination::suppressTime
virtual void suppressTime()
Definition: ELdestination.cc:179
edm::service::ELdestination::suppressSerial
virtual void suppressSerial()
Definition: ELdestination.cc:185
edm::service::ELdestination::includeSubroutine
virtual void includeSubroutine()
Definition: ELdestination.cc:177
edm::service::ELdestination::setTableLimit
virtual void setTableLimit(int n)
Definition: ELdestination.cc:146
pfDeepBoostedJetPreprocessParams_cfi.sv
sv
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:226
edm::service::ELdestination::respondToMostModules
bool respondToMostModules
Definition: ELdestination.h:127
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
edm::service::ELdestination::setLimit
void setLimit(const ELstring &s, int n)
Definition: ELdestination.cc:94
edm::service::ELdestination::finish
virtual void finish()
Definition: ELdestination.cc:144
ELdestination.h
edm::service::ELdestination::ELdestination
ELdestination()
Definition: ELdestination.cc:42
edm::service::ELdestination::setLineLength
virtual int setLineLength(int len)
Definition: ELdestination.cc:199
edm::service::ELdestination::ignoreMostModules
bool ignoreMostModules
Definition: ELdestination.h:125
edm::ELhighestSeverity
const ELslProxy< ELhighestSeverityGen > ELhighestSeverity
Definition: ELseverityLevel.cc:326
edm::service::ELdestination::setTimespan
void setTimespan(const ELstring &s, int n)
Definition: ELdestination.cc:102
beam_dqm_sourceclient-live_cfg.cerr
cerr
Definition: beam_dqm_sourceclient-live_cfg.py:17
edm::service::ELdestination::includeContext
virtual void includeContext()
Definition: ELdestination.cc:183
edm::service::ELdestination::separateEpilogue
virtual void separateEpilogue()
Definition: ELdestination.cc:194
edm::service::ELlimitsTable::setTableLimit
void setTableLimit(int n)
Definition: ELlimitsTable.cc:63
edm::service::ELdestination::includeTime
virtual void includeTime()
Definition: ELdestination.cc:180
readEcalDQMStatus.interval
interval
Definition: readEcalDQMStatus.py:18
edm::service::noosMsg
static const ELstring noosMsg
Definition: ELdestination.cc:83
edm::service::ELdestination::includeModule
virtual void includeModule()
Definition: ELdestination.cc:174
edm::service::ELdestination::~ELdestination
virtual ~ELdestination()
Definition: ELdestination.cc:60
TH2PolyOfflineMaps.limits
limits
Definition: TH2PolyOfflineMaps.py:45
edm::service::ELdestination::limits
ELlimitsTable limits
Definition: ELdestination.h:120
edm::service::ELdestination::includeText
virtual void includeText()
Definition: ELdestination.cc:171
edm::service::ELdestination::threshold
ELseverityLevel threshold
Definition: ELdestination.h:118
edm::service::ELdestination::attachEpilogue
virtual void attachEpilogue()
Definition: ELdestination.cc:195
edm::ELseverityLevel
Definition: ELseverityLevel.h:96
edm::service::ELlimitsTable::setInterval
void setInterval(const ELstring &id, int interval)
Definition: ELlimitsTable.cc:205
edm::service::ELlimitsTable::zero
void zero()
Definition: ELlimitsTable.cc:187
edm::service::ELdestination::defaultLineLength
static const int defaultLineLength
Definition: ELdestination.h:131
edm::service::close_and_delete::operator()
void operator()(std::ostream *os) const
Definition: ELdestination.cc:221
edm::service::ELdestination::wipe
virtual void wipe()
Definition: ELdestination.cc:106
util.rrClient.indent
indent
Definition: rrClient.py:41
edm::service::ELdestination::getLineLength
virtual int getLineLength() const
Definition: ELdestination.cc:205
edm::moduleName
std::string moduleName(Provenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:27
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:426
edm::service::ELdestination::excludeModule
virtual void excludeModule(ELstring const &moduleName)
Definition: ELdestination.cc:139
edm::service::ELdestination::log
virtual bool log(const edm::ErrorObj &msg)
Definition: ELdestination.cc:71
edm::service::ELdestination::setTraceThreshold
void setTraceThreshold(const ELseverityLevel &sv)
Definition: ELdestination.cc:92
MessageLogger_cfi.lineLength
lineLength
Definition: MessageLogger_cfi.py:5
edm::service::ELdestination::attachTime
virtual void attachTime()
Definition: ELdestination.cc:192
edm::service::ELdestination::ignoreThese
std::unordered_set< std::string > ignoreThese
Definition: ELdestination.h:128