CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 
20 
21 namespace edm {
22  namespace service {
23 
25  std::string thr = "";
26  auto d = destination.find(dest);
27  if (d != destination.end()) {
28  auto const& destin = d->second;
29  thr = destin.threshold;
30  }
31  auto dd = destination.find("default");
32  if (thr.empty()) {
33  if (dd != destination.end()) {
34  auto const& def_destin = dd->second;
35  thr = def_destin.threshold;
36  }
37  }
38  return thr;
39  } // threshold
40 
42  std::string otpt = "";
43  auto d = destination.find(dest);
44  if (d != destination.end()) {
45  auto const& 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  auto d = destination.find(dest);
55  if (d != destination.end()) {
56  auto const& destin = d->second;
57  auto c = destin.category.find(cat);
58  if (c != destin.category.end()) {
59  lim = c->second.limit;
60  }
61  }
62  auto dd = destination.find("default");
63  if (lim == NO_VALUE_SET) {
64  if (dd != destination.end()) {
65  auto const& def_destin = dd->second;
66  auto 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  auto const& destin = d->second;
75  auto 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  auto const& def_destin = dd->second;
84  auto 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  auto d = destination.find(dest);
96  if (d != destination.end()) {
97  auto const& destin = d->second;
98  auto c = destin.category.find(cat);
99  if (c != destin.category.end()) {
100  re = c->second.reportEvery;
101  }
102  }
103  auto dd = destination.find("default");
104  if (re == NO_VALUE_SET) {
105  if (dd != destination.end()) {
106  auto const& def_destin = dd->second;
107  auto 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  auto const& destin = d->second;
116  auto 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  auto const& def_destin = dd->second;
125  auto 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  auto d = destination.find(dest);
137  if (d != destination.end()) {
138  auto const& destin = d->second;
139  auto c = destin.category.find(cat);
140  if (c != destin.category.end()) {
141  tim = c->second.timespan;
142  }
143  }
144  auto dd = destination.find("default");
145  if (tim == NO_VALUE_SET) {
146  if (dd != destination.end()) {
147  auto const& def_destin = dd->second;
148  auto 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  auto const& destin = d->second;
157  auto 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  auto const& def_destin = dd->second;
166  auto 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  auto d = destination.find(dest);
178  if (d != destination.end()) {
179  auto const& destin = d->second;
180  auto c = destin.sev.find(cat);
181  if (c != destin.sev.end()) {
182  lim = c->second.limit;
183  }
184  }
185  auto dd = destination.find("default");
186  if (lim == NO_VALUE_SET) {
187  if (dd != destination.end()) {
188  auto const& def_destin = dd->second;
189  auto 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  auto const& destin = d->second;
198  auto 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  auto const& def_destin = dd->second;
207  auto 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  auto d = destination.find(dest);
219  if (d != destination.end()) {
220  auto const& destin = d->second;
221  auto c = destin.sev.find(cat);
222  if (c != destin.sev.end()) {
223  re = c->second.reportEvery;
224  }
225  }
226  auto dd = destination.find("default");
227  if (re == NO_VALUE_SET) {
228  if (dd != destination.end()) {
229  auto const& def_destin = dd->second;
230  auto 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  auto const& destin = d->second;
239  auto 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  auto const& def_destin = dd->second;
248  auto 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  auto d = destination.find(dest);
260  if (d != destination.end()) {
261  auto const& destin = d->second;
262  auto c = destin.sev.find(cat);
263  if (c != destin.sev.end()) {
264  tim = c->second.timespan;
265  }
266  }
267  auto dd = destination.find("default");
268  if (tim == NO_VALUE_SET) {
269  if (dd != destination.end()) {
270  auto const& def_destin = dd->second;
271  auto 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  auto const& destin = d->second;
280  auto 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  auto const& def_destin = dd->second;
289  auto 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
std::optional< eventsetup::EventSetupRecordGeneric > find(const eventsetup::EventSetupRecordKey &iKey) const
Definition: EventSetup.h:178
std::map< std::string, Destination > destination
int sev_reportEvery(std::string const &dest, std::string const &sev) const
int sev_limit(std::string const &dest, std::string const &sev) const
const edm::EventSetup & c
int limit(std::string const &dest, std::string const &cat) const
tuple d
Definition: ztail.py:151
int reportEvery(std::string const &dest, std::string const &cat) const
def cat
Definition: eostools.py:401
std::string threshold(std::string const &dest) const
int sev_timespan(std::string const &dest, std::string const &sev) const
int timespan(std::string const &dest, std::string const &cat) const
std::string output(std::string const &dest) const