CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
19 
20 
22 
23 namespace edm {
24 namespace service {
25 
29 {
30  std::string thr = "";
31  std::map<std::string,Destination>::iterator d = destination.find(dest);
32  if (d != destination.end()) {
33  Destination & destin = d->second;
34  thr = destin.threshold;
35  }
36  std::map<std::string,Destination>::iterator dd = destination.find("default");
37  if ( thr == "" ) {
38  if (dd != destination.end()) {
39  Destination & def_destin = dd->second;
40  thr = def_destin.threshold;
41  }
42  }
43  return thr;
44 } // threshold
45 
49 {
50  std::string otpt = "";
51  std::map<std::string,Destination>::iterator d = destination.find(dest);
52  if (d != destination.end()) {
53  Destination & destin = d->second;
54  otpt = destin.output;
55  }
56  // There is no default output; so if we did not find the dest, then return ""
57  return otpt;
58 } // output
59 
60 int
63 {
64  int lim = NO_VALUE_SET;
65  std::map<std::string,Destination>::iterator d = destination.find(dest);
66  if (d != destination.end()) {
67  Destination & destin = d->second;
68  std::map<std::string,Category>::iterator c = destin.category.find(cat);
69  if (c != destin.category.end()) {
70  lim = c->second.limit;
71  }
72  }
73  std::map<std::string,Destination>::iterator dd = destination.find("default");
74  if ( lim == NO_VALUE_SET ) {
75  if (dd != destination.end()) {
76  Destination & def_destin = dd->second;
77  std::map<std::string,Category>::iterator
78  c = def_destin.category.find(cat);
79  if (c != def_destin.category.end()) {
80  lim = c->second.limit;
81  }
82  }
83  }
84  if ( lim == NO_VALUE_SET ) {
85  if (d != destination.end()) {
86  Destination & destin = d->second;
87  std::map<std::string,Category>::iterator
88  cd = destin.category.find("default");
89  if (cd != destin.category.end()) {
90  lim = cd->second.limit;
91  }
92  }
93  }
94  if ( lim == NO_VALUE_SET ) {
95  if (dd != destination.end()) {
96  Destination & def_destin = dd->second;
97  std::map<std::string,Category>::iterator
98  cdd = def_destin.category.find("default");
99  if (cdd != def_destin.category.end()) {
100  lim = cdd->second.limit;
101  }
102  }
103  }
104  return lim;
105 } // limit
106 
107 int
110 {
111  int re = NO_VALUE_SET;
112  std::map<std::string,Destination>::iterator d = destination.find(dest);
113  if (d != destination.end()) {
114  Destination & destin = d->second;
115  std::map<std::string,Category>::iterator c = destin.category.find(cat);
116  if (c != destin.category.end()) {
117  re = c->second.reportEvery;
118  }
119  }
120  std::map<std::string,Destination>::iterator dd = destination.find("default");
121  if ( re == NO_VALUE_SET ) {
122  if (dd != destination.end()) {
123  Destination & def_destin = dd->second;
124  std::map<std::string,Category>::iterator
125  c = def_destin.category.find(cat);
126  if (c != def_destin.category.end()) {
127  re = c->second.reportEvery;
128  }
129  }
130  }
131  if ( re == NO_VALUE_SET ) {
132  if (d != destination.end()) {
133  Destination & destin = d->second;
134  std::map<std::string,Category>::iterator
135  cd = destin.category.find("default");
136  if (cd != destin.category.end()) {
137  re = cd->second.reportEvery;
138  }
139  }
140  }
141  if ( re == NO_VALUE_SET ) {
142  if (dd != destination.end()) {
143  Destination & def_destin = dd->second;
144  std::map<std::string,Category>::iterator
145  cdd = def_destin.category.find("default");
146  if (cdd != def_destin.category.end()) {
147  re = cdd->second.reportEvery;
148  }
149  }
150  }
151  return re;
152 } // reportEvery
153 
154 int
157 {
158  int tim = NO_VALUE_SET;
159  std::map<std::string,Destination>::iterator d = destination.find(dest);
160  if (d != destination.end()) {
161  Destination & destin = d->second;
162  std::map<std::string,Category>::iterator c = destin.category.find(cat);
163  if (c != destin.category.end()) {
164  tim = c->second.timespan;
165  }
166  }
167  std::map<std::string,Destination>::iterator dd = destination.find("default");
168  if ( tim == NO_VALUE_SET ) {
169  if (dd != destination.end()) {
170  Destination & def_destin = dd->second;
171  std::map<std::string,Category>::iterator
172  c = def_destin.category.find(cat);
173  if (c != def_destin.category.end()) {
174  tim = c->second.timespan;
175  }
176  }
177  }
178  if ( tim == NO_VALUE_SET ) {
179  if (d != destination.end()) {
180  Destination & destin = d->second;
181  std::map<std::string,Category>::iterator
182  cd = destin.category.find("default");
183  if (cd != destin.category.end()) {
184  tim = cd->second.timespan;
185  }
186  }
187  }
188  if ( tim == NO_VALUE_SET ) {
189  if (dd != destination.end()) {
190  Destination & def_destin = dd->second;
191  std::map<std::string,Category>::iterator
192  cdd = def_destin.category.find("default");
193  if (cdd != def_destin.category.end()) {
194  tim = cdd->second.timespan;
195  }
196  }
197  }
198  return tim;
199 } // timespan
200 
201 int
204 {
205  int lim = NO_VALUE_SET;
206  std::map<std::string,Destination>::iterator d = destination.find(dest);
207  if (d != destination.end()) {
208  Destination & destin = d->second;
209  std::map<std::string,Category>::iterator c = destin.sev.find(cat);
210  if (c != destin.sev.end()) {
211  lim = c->second.limit;
212  }
213  }
214  std::map<std::string,Destination>::iterator dd = destination.find("default");
215  if ( lim == NO_VALUE_SET ) {
216  if (dd != destination.end()) {
217  Destination & def_destin = dd->second;
218  std::map<std::string,Category>::iterator
219  c = def_destin.sev.find(cat);
220  if (c != def_destin.sev.end()) {
221  lim = c->second.limit;
222  }
223  }
224  }
225  if ( lim == NO_VALUE_SET ) {
226  if (d != destination.end()) {
227  Destination & destin = d->second;
228  std::map<std::string,Category>::iterator
229  cd = destin.sev.find("default");
230  if (cd != destin.sev.end()) {
231  lim = cd->second.limit;
232  }
233  }
234  }
235  if ( lim == NO_VALUE_SET ) {
236  if (dd != destination.end()) {
237  Destination & def_destin = dd->second;
238  std::map<std::string,Category>::iterator
239  cdd = def_destin.sev.find("default");
240  if (cdd != def_destin.sev.end()) {
241  lim = cdd->second.limit;
242  }
243  }
244  }
245  return lim;
246 } // sev_limit
247 
248 int
251 {
252  int re = NO_VALUE_SET;
253  std::map<std::string,Destination>::iterator d = destination.find(dest);
254  if (d != destination.end()) {
255  Destination & destin = d->second;
256  std::map<std::string,Category>::iterator c = destin.sev.find(cat);
257  if (c != destin.sev.end()) {
258  re = c->second.reportEvery;
259  }
260  }
261  std::map<std::string,Destination>::iterator dd = destination.find("default");
262  if ( re == NO_VALUE_SET ) {
263  if (dd != destination.end()) {
264  Destination & def_destin = dd->second;
265  std::map<std::string,Category>::iterator
266  c = def_destin.sev.find(cat);
267  if (c != def_destin.sev.end()) {
268  re = c->second.reportEvery;
269  }
270  }
271  }
272  if ( re == NO_VALUE_SET ) {
273  if (d != destination.end()) {
274  Destination & destin = d->second;
275  std::map<std::string,Category>::iterator
276  cd = destin.sev.find("default");
277  if (cd != destin.sev.end()) {
278  re = cd->second.reportEvery;
279  }
280  }
281  }
282  if ( re == NO_VALUE_SET ) {
283  if (dd != destination.end()) {
284  Destination & def_destin = dd->second;
285  std::map<std::string,Category>::iterator
286  cdd = def_destin.sev.find("default");
287  if (cdd != def_destin.sev.end()) {
288  re = cdd->second.reportEvery;
289  }
290  }
291  }
292  return re;
293 } // sev_reportEvery
294 
295 int
298 {
299  int tim = NO_VALUE_SET;
300  std::map<std::string,Destination>::iterator d = destination.find(dest);
301  if (d != destination.end()) {
302  Destination & destin = d->second;
303  std::map<std::string,Category>::iterator c = destin.sev.find(cat);
304  if (c != destin.sev.end()) {
305  tim = c->second.timespan;
306  }
307  }
308  std::map<std::string,Destination>::iterator dd = destination.find("default");
309  if ( tim == NO_VALUE_SET ) {
310  if (dd != destination.end()) {
311  Destination & def_destin = dd->second;
312  std::map<std::string,Category>::iterator
313  c = def_destin.sev.find(cat);
314  if (c != def_destin.sev.end()) {
315  tim = c->second.timespan;
316  }
317  }
318  }
319  if ( tim == NO_VALUE_SET ) {
320  if (d != destination.end()) {
321  Destination & destin = d->second;
322  std::map<std::string,Category>::iterator
323  cd = destin.sev.find("default");
324  if (cd != destin.sev.end()) {
325  tim = cd->second.timespan;
326  }
327  }
328  }
329  if ( tim == NO_VALUE_SET ) {
330  if (dd != destination.end()) {
331  Destination & def_destin = dd->second;
332  std::map<std::string,Category>::iterator
333  cdd = def_destin.sev.find("default");
334  if (cdd != def_destin.sev.end()) {
335  tim = cdd->second.timespan;
336  }
337  }
338  }
339  return tim;
340 } // sev_timespan
341 
342 
343 
344 
345 } // end of namespace service
346 } // end of namespace edm
347 
int timespan(std::string const &dest, std::string const &cat)
std::string threshold(std::string const &dest)
std::string output(std::string const &dest)
tuple d
Definition: ztail.py:151
def cat
Definition: eostools.py:398
int sev_reportEvery(std::string const &dest, std::string const &sev)
int reportEvery(std::string const &dest, std::string const &cat)
std::map< std::string, Destination > destination
int limit(std::string const &dest, std::string const &cat)
int sev_limit(std::string const &dest, std::string const &sev)
int sev_timespan(std::string const &dest, std::string const &sev)