CMS 3D CMS Logo

MessageLoggerDefaults.cc
Go to the documentation of this file.
1 // ----------------------------------------------------------------------
2 //
3 // MessageLoggerDefaults.cc
4 //
5 // All the mechanics of hardwired defaults, but without the values, which are
6 // coded in HardwiredDefaults.cc
7 //
8 // Changes:
9 //
10 // 11/02/07 mf Corrected sev_limit, sev_reportEvery, and sev_timespan
11 // changing if (c != def_destin.category.end()) to
12 // if (c != def_destin.sev.end()) if 4 places in each.
13 // This fixes the skipped framework job report message
14 // problem. The bug also could have been causing other
15 // messages to be skipped.
16 //
17 // ----------------------------------------------------------------------
18 
20 
21 namespace edm {
22  namespace service {
23 
25  std::string thr = "";
26  std::map<std::string, Destination>::iterator d = destination.find(dest);
27  if (d != destination.end()) {
28  Destination& destin = d->second;
29  thr = destin.threshold;
30  }
31  std::map<std::string, Destination>::iterator dd = destination.find("default");
32  if (thr.empty()) {
33  if (dd != destination.end()) {
34  Destination& def_destin = dd->second;
35  thr = def_destin.threshold;
36  }
37  }
38  return thr;
39  } // threshold
40 
42  std::string otpt = "";
43  std::map<std::string, Destination>::iterator d = destination.find(dest);
44  if (d != destination.end()) {
45  Destination& destin = d->second;
46  otpt = destin.output;
47  }
48  // There is no default output; so if we did not find the dest, then return ""
49  return otpt;
50  } // output
51 
53  int lim = NO_VALUE_SET;
54  std::map<std::string, Destination>::iterator d = destination.find(dest);
55  if (d != destination.end()) {
56  Destination& destin = d->second;
57  std::map<std::string, Category>::iterator c = destin.category.find(cat);
58  if (c != destin.category.end()) {
59  lim = c->second.limit;
60  }
61  }
62  std::map<std::string, Destination>::iterator dd = destination.find("default");
63  if (lim == NO_VALUE_SET) {
64  if (dd != destination.end()) {
65  Destination& def_destin = dd->second;
66  std::map<std::string, Category>::iterator c = def_destin.category.find(cat);
67  if (c != def_destin.category.end()) {
68  lim = c->second.limit;
69  }
70  }
71  }
72  if (lim == NO_VALUE_SET) {
73  if (d != destination.end()) {
74  Destination& destin = d->second;
75  std::map<std::string, Category>::iterator cd = destin.category.find("default");
76  if (cd != destin.category.end()) {
77  lim = cd->second.limit;
78  }
79  }
80  }
81  if (lim == NO_VALUE_SET) {
82  if (dd != destination.end()) {
83  Destination& def_destin = dd->second;
84  std::map<std::string, Category>::iterator cdd = def_destin.category.find("default");
85  if (cdd != def_destin.category.end()) {
86  lim = cdd->second.limit;
87  }
88  }
89  }
90  return lim;
91  } // limit
92 
94  int re = NO_VALUE_SET;
95  std::map<std::string, Destination>::iterator d = destination.find(dest);
96  if (d != destination.end()) {
97  Destination& destin = d->second;
98  std::map<std::string, Category>::iterator c = destin.category.find(cat);
99  if (c != destin.category.end()) {
100  re = c->second.reportEvery;
101  }
102  }
103  std::map<std::string, Destination>::iterator dd = destination.find("default");
104  if (re == NO_VALUE_SET) {
105  if (dd != destination.end()) {
106  Destination& def_destin = dd->second;
107  std::map<std::string, Category>::iterator c = def_destin.category.find(cat);
108  if (c != def_destin.category.end()) {
109  re = c->second.reportEvery;
110  }
111  }
112  }
113  if (re == NO_VALUE_SET) {
114  if (d != destination.end()) {
115  Destination& destin = d->second;
116  std::map<std::string, Category>::iterator cd = destin.category.find("default");
117  if (cd != destin.category.end()) {
118  re = cd->second.reportEvery;
119  }
120  }
121  }
122  if (re == NO_VALUE_SET) {
123  if (dd != destination.end()) {
124  Destination& def_destin = dd->second;
125  std::map<std::string, Category>::iterator cdd = def_destin.category.find("default");
126  if (cdd != def_destin.category.end()) {
127  re = cdd->second.reportEvery;
128  }
129  }
130  }
131  return re;
132  } // reportEvery
133 
135  int tim = NO_VALUE_SET;
136  std::map<std::string, Destination>::iterator d = destination.find(dest);
137  if (d != destination.end()) {
138  Destination& destin = d->second;
139  std::map<std::string, Category>::iterator c = destin.category.find(cat);
140  if (c != destin.category.end()) {
141  tim = c->second.timespan;
142  }
143  }
144  std::map<std::string, Destination>::iterator dd = destination.find("default");
145  if (tim == NO_VALUE_SET) {
146  if (dd != destination.end()) {
147  Destination& def_destin = dd->second;
148  std::map<std::string, Category>::iterator c = def_destin.category.find(cat);
149  if (c != def_destin.category.end()) {
150  tim = c->second.timespan;
151  }
152  }
153  }
154  if (tim == NO_VALUE_SET) {
155  if (d != destination.end()) {
156  Destination& destin = d->second;
157  std::map<std::string, Category>::iterator cd = destin.category.find("default");
158  if (cd != destin.category.end()) {
159  tim = cd->second.timespan;
160  }
161  }
162  }
163  if (tim == NO_VALUE_SET) {
164  if (dd != destination.end()) {
165  Destination& def_destin = dd->second;
166  std::map<std::string, Category>::iterator cdd = def_destin.category.find("default");
167  if (cdd != def_destin.category.end()) {
168  tim = cdd->second.timespan;
169  }
170  }
171  }
172  return tim;
173  } // timespan
174 
176  int lim = NO_VALUE_SET;
177  std::map<std::string, Destination>::iterator d = destination.find(dest);
178  if (d != destination.end()) {
179  Destination& destin = d->second;
180  std::map<std::string, Category>::iterator c = destin.sev.find(cat);
181  if (c != destin.sev.end()) {
182  lim = c->second.limit;
183  }
184  }
185  std::map<std::string, Destination>::iterator dd = destination.find("default");
186  if (lim == NO_VALUE_SET) {
187  if (dd != destination.end()) {
188  Destination& def_destin = dd->second;
189  std::map<std::string, Category>::iterator c = def_destin.sev.find(cat);
190  if (c != def_destin.sev.end()) {
191  lim = c->second.limit;
192  }
193  }
194  }
195  if (lim == NO_VALUE_SET) {
196  if (d != destination.end()) {
197  Destination& destin = d->second;
198  std::map<std::string, Category>::iterator cd = destin.sev.find("default");
199  if (cd != destin.sev.end()) {
200  lim = cd->second.limit;
201  }
202  }
203  }
204  if (lim == NO_VALUE_SET) {
205  if (dd != destination.end()) {
206  Destination& def_destin = dd->second;
207  std::map<std::string, Category>::iterator cdd = def_destin.sev.find("default");
208  if (cdd != def_destin.sev.end()) {
209  lim = cdd->second.limit;
210  }
211  }
212  }
213  return lim;
214  } // sev_limit
215 
217  int re = NO_VALUE_SET;
218  std::map<std::string, Destination>::iterator d = destination.find(dest);
219  if (d != destination.end()) {
220  Destination& destin = d->second;
221  std::map<std::string, Category>::iterator c = destin.sev.find(cat);
222  if (c != destin.sev.end()) {
223  re = c->second.reportEvery;
224  }
225  }
226  std::map<std::string, Destination>::iterator dd = destination.find("default");
227  if (re == NO_VALUE_SET) {
228  if (dd != destination.end()) {
229  Destination& def_destin = dd->second;
230  std::map<std::string, Category>::iterator c = def_destin.sev.find(cat);
231  if (c != def_destin.sev.end()) {
232  re = c->second.reportEvery;
233  }
234  }
235  }
236  if (re == NO_VALUE_SET) {
237  if (d != destination.end()) {
238  Destination& destin = d->second;
239  std::map<std::string, Category>::iterator cd = destin.sev.find("default");
240  if (cd != destin.sev.end()) {
241  re = cd->second.reportEvery;
242  }
243  }
244  }
245  if (re == NO_VALUE_SET) {
246  if (dd != destination.end()) {
247  Destination& def_destin = dd->second;
248  std::map<std::string, Category>::iterator cdd = def_destin.sev.find("default");
249  if (cdd != def_destin.sev.end()) {
250  re = cdd->second.reportEvery;
251  }
252  }
253  }
254  return re;
255  } // sev_reportEvery
256 
258  int tim = NO_VALUE_SET;
259  std::map<std::string, Destination>::iterator d = destination.find(dest);
260  if (d != destination.end()) {
261  Destination& destin = d->second;
262  std::map<std::string, Category>::iterator c = destin.sev.find(cat);
263  if (c != destin.sev.end()) {
264  tim = c->second.timespan;
265  }
266  }
267  std::map<std::string, Destination>::iterator dd = destination.find("default");
268  if (tim == NO_VALUE_SET) {
269  if (dd != destination.end()) {
270  Destination& def_destin = dd->second;
271  std::map<std::string, Category>::iterator c = def_destin.sev.find(cat);
272  if (c != def_destin.sev.end()) {
273  tim = c->second.timespan;
274  }
275  }
276  }
277  if (tim == NO_VALUE_SET) {
278  if (d != destination.end()) {
279  Destination& destin = d->second;
280  std::map<std::string, Category>::iterator cd = destin.sev.find("default");
281  if (cd != destin.sev.end()) {
282  tim = cd->second.timespan;
283  }
284  }
285  }
286  if (tim == NO_VALUE_SET) {
287  if (dd != destination.end()) {
288  Destination& def_destin = dd->second;
289  std::map<std::string, Category>::iterator cdd = def_destin.sev.find("default");
290  if (cdd != def_destin.sev.end()) {
291  tim = cdd->second.timespan;
292  }
293  }
294  }
295  return tim;
296  } // sev_timespan
297 
298  } // end of namespace service
299 } // end of namespace edm
service
Definition: service.py:1
edm::service::MessageLoggerDefaults::Destination::sev
std::map< std::string, Category > sev
Definition: MessageLoggerDefaults.h:84
edm::service::MessageLoggerDefaults::Destination::category
std::map< std::string, Category > category
Definition: MessageLoggerDefaults.h:83
edm::service::MessageLoggerDefaults::limit
int limit(std::string const &dest, std::string const &cat)
Definition: MessageLoggerDefaults.cc:52
edm
HLT enums.
Definition: AlignableModifier.h:19
eostools.cat
def cat(path)
Definition: eostools.py:401
edm::service::MessageLoggerDefaults::sev_limit
int sev_limit(std::string const &dest, std::string const &sev)
Definition: MessageLoggerDefaults.cc:175
edm::service::MessageLoggerDefaults::Destination
Definition: MessageLoggerDefaults.h:81
edm::service::MessageLoggerDefaults::sev_timespan
int sev_timespan(std::string const &dest, std::string const &sev)
Definition: MessageLoggerDefaults.cc:257
edm::service::MessageLoggerDefaults::destination
std::map< std::string, Destination > destination
Definition: MessageLoggerDefaults.h:94
createTree.dd
string dd
Definition: createTree.py:154
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::service::MessageLoggerDefaults::timespan
int timespan(std::string const &dest, std::string const &cat)
Definition: MessageLoggerDefaults.cc:134
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
edm::service::MessageLoggerDefaults::threshold
std::string threshold(std::string const &dest)
Definition: MessageLoggerDefaults.cc:24
edm::service::MessageLoggerDefaults::NO_VALUE_SET
static const int NO_VALUE_SET
Definition: MessageLoggerDefaults.h:71
edm::service::MessageLoggerDefaults::Destination::output
std::string output
Definition: MessageLoggerDefaults.h:85
edm::service::MessageLoggerDefaults::output
std::string output(std::string const &dest)
Definition: MessageLoggerDefaults.cc:41
hippyaddtobaddatafiles.cd
def cd(newdir)
Definition: hippyaddtobaddatafiles.py:40
ztail.d
d
Definition: ztail.py:151
edm::service::MessageLoggerDefaults::sev_reportEvery
int sev_reportEvery(std::string const &dest, std::string const &sev)
Definition: MessageLoggerDefaults.cc:216
MessageLoggerDefaults.h
edm::service::MessageLoggerDefaults::Destination::threshold
std::string threshold
Definition: MessageLoggerDefaults.h:82
mps_fire.dest
dest
Definition: mps_fire.py:179
edm::service::MessageLoggerDefaults::reportEvery
int reportEvery(std::string const &dest, std::string const &cat)
Definition: MessageLoggerDefaults.cc:93