CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_6/src/FWCore/MessageService/src/MessageLoggerDefaults.cc

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------
00002 //
00003 // MessageLoggerDefaults.cc
00004 //
00005 // All the mechanics of hardwired defaults, but without the values, which are
00006 // coded in HardwiredDefaults.cc
00007 //
00008 // Changes:
00009 //
00010 // 11/02/07 mf  Corrected sev_limit, sev_reportEvery, and sev_timespan
00011 //              changing if (c != def_destin.category.end()) to
00012 //              if (c != def_destin.sev.end()) if 4 places in each.
00013 //              This fixes the skipped framework job report message 
00014 //              problem.  The bug also could have been causing other 
00015 //              messages to be skipped.  
00016 //
00017 // ----------------------------------------------------------------------
00018 
00019 
00020 
00021 #include "FWCore/MessageService/interface/MessageLoggerDefaults.h"
00022 
00023 namespace edm {
00024 namespace service {
00025 
00026 std::string 
00027 MessageLoggerDefaults::
00028 threshold(std::string const & dest)
00029 {
00030   std::string thr = "";
00031   std::map<std::string,Destination>::iterator d = destination.find(dest);  
00032   if (d != destination.end()) {
00033     Destination & destin = d->second;
00034     thr = destin.threshold;
00035   }
00036   std::map<std::string,Destination>::iterator dd = destination.find("default");
00037   if ( thr == "" ) { 
00038     if (dd != destination.end()) {
00039       Destination & def_destin = dd->second;
00040       thr = def_destin.threshold;
00041     }
00042   }
00043   return thr;   
00044 } // threshold
00045 
00046 std::string 
00047 MessageLoggerDefaults::
00048 output(std::string const & dest)
00049 {
00050   std::string otpt = "";
00051   std::map<std::string,Destination>::iterator d = destination.find(dest);  
00052   if (d != destination.end()) {
00053     Destination & destin = d->second;
00054     otpt = destin.output;
00055   }
00056   // There is no default output; so if we did not find the dest, then return ""
00057   return otpt;   
00058 } // output
00059 
00060 int 
00061 MessageLoggerDefaults::
00062 limit(std::string const & dest, std::string const & cat)
00063 {
00064   int lim = NO_VALUE_SET;
00065   std::map<std::string,Destination>::iterator d = destination.find(dest);  
00066   if (d != destination.end()) {
00067     Destination & destin = d->second;
00068     std::map<std::string,Category>::iterator c = destin.category.find(cat);
00069     if (c != destin.category.end()) {
00070       lim = c->second.limit;
00071     } 
00072   }
00073   std::map<std::string,Destination>::iterator dd = destination.find("default");
00074   if ( lim == NO_VALUE_SET ) { 
00075     if (dd != destination.end()) {
00076       Destination & def_destin = dd->second;
00077       std::map<std::string,Category>::iterator 
00078                       c = def_destin.category.find(cat);
00079       if (c != def_destin.category.end()) {
00080         lim = c->second.limit;
00081       } 
00082     }
00083   }
00084   if ( lim == NO_VALUE_SET ) { 
00085     if (d != destination.end()) {
00086       Destination & destin = d->second;
00087       std::map<std::string,Category>::iterator 
00088                       cd = destin.category.find("default");
00089       if (cd != destin.category.end()) {
00090         lim = cd->second.limit;
00091       } 
00092     }
00093   }     
00094   if ( lim == NO_VALUE_SET ) { 
00095     if (dd != destination.end()) {
00096       Destination & def_destin = dd->second;
00097       std::map<std::string,Category>::iterator 
00098                       cdd = def_destin.category.find("default");
00099       if (cdd != def_destin.category.end()) {
00100         lim = cdd->second.limit;
00101       } 
00102     }
00103   }     
00104   return lim;   
00105 } // limit
00106 
00107 int 
00108 MessageLoggerDefaults::
00109 reportEvery(std::string const & dest, std::string const & cat)
00110 {
00111   int re = NO_VALUE_SET;
00112   std::map<std::string,Destination>::iterator d = destination.find(dest);  
00113   if (d != destination.end()) {
00114     Destination & destin = d->second;
00115     std::map<std::string,Category>::iterator c = destin.category.find(cat);
00116     if (c != destin.category.end()) {
00117       re = c->second.reportEvery;
00118     } 
00119   }
00120   std::map<std::string,Destination>::iterator dd = destination.find("default");
00121   if ( re == NO_VALUE_SET ) { 
00122     if (dd != destination.end()) {
00123       Destination & def_destin = dd->second;
00124       std::map<std::string,Category>::iterator 
00125                       c = def_destin.category.find(cat);
00126       if (c != def_destin.category.end()) {
00127         re = c->second.reportEvery;
00128       } 
00129     }
00130   }
00131   if ( re == NO_VALUE_SET ) { 
00132     if (d != destination.end()) {
00133       Destination & destin = d->second;
00134       std::map<std::string,Category>::iterator 
00135                       cd = destin.category.find("default");
00136       if (cd != destin.category.end()) {
00137         re = cd->second.reportEvery;
00138       } 
00139     }
00140   }     
00141   if ( re == NO_VALUE_SET ) { 
00142     if (dd != destination.end()) {
00143       Destination & def_destin = dd->second;
00144       std::map<std::string,Category>::iterator 
00145                       cdd = def_destin.category.find("default");
00146       if (cdd != def_destin.category.end()) {
00147         re = cdd->second.reportEvery;
00148       } 
00149     }
00150   }     
00151   return re;   
00152 } // reportEvery
00153 
00154 int 
00155 MessageLoggerDefaults::
00156 timespan(std::string const & dest, std::string const & cat)
00157 {
00158   int tim = NO_VALUE_SET;
00159   std::map<std::string,Destination>::iterator d = destination.find(dest);  
00160   if (d != destination.end()) {
00161     Destination & destin = d->second;
00162     std::map<std::string,Category>::iterator c = destin.category.find(cat);
00163     if (c != destin.category.end()) {
00164       tim = c->second.timespan;
00165     } 
00166   }
00167   std::map<std::string,Destination>::iterator dd = destination.find("default");
00168   if ( tim == NO_VALUE_SET ) { 
00169     if (dd != destination.end()) {
00170       Destination & def_destin = dd->second;
00171       std::map<std::string,Category>::iterator 
00172                       c = def_destin.category.find(cat);
00173       if (c != def_destin.category.end()) {
00174         tim = c->second.timespan;
00175       } 
00176     }
00177   }
00178   if ( tim == NO_VALUE_SET ) { 
00179     if (d != destination.end()) {
00180       Destination & destin = d->second;
00181       std::map<std::string,Category>::iterator 
00182                       cd = destin.category.find("default");
00183       if (cd != destin.category.end()) {
00184         tim = cd->second.timespan;
00185       } 
00186     }
00187   }     
00188   if ( tim == NO_VALUE_SET ) { 
00189     if (dd != destination.end()) {
00190       Destination & def_destin = dd->second;
00191       std::map<std::string,Category>::iterator 
00192                       cdd = def_destin.category.find("default");
00193       if (cdd != def_destin.category.end()) {
00194         tim = cdd->second.timespan;
00195       } 
00196     }
00197   }     
00198   return tim;   
00199 } // timespan
00200 
00201 int 
00202 MessageLoggerDefaults::
00203 sev_limit(std::string const & dest, std::string const & cat)
00204 {
00205   int lim = NO_VALUE_SET;
00206   std::map<std::string,Destination>::iterator d = destination.find(dest);  
00207   if (d != destination.end()) {
00208     Destination & destin = d->second;
00209     std::map<std::string,Category>::iterator c = destin.sev.find(cat);
00210     if (c != destin.sev.end()) {
00211       lim = c->second.limit;
00212     } 
00213   }
00214   std::map<std::string,Destination>::iterator dd = destination.find("default");
00215   if ( lim == NO_VALUE_SET ) { 
00216     if (dd != destination.end()) {
00217       Destination & def_destin = dd->second;
00218       std::map<std::string,Category>::iterator 
00219                       c = def_destin.sev.find(cat);
00220       if (c != def_destin.sev.end()) {
00221         lim = c->second.limit;
00222       } 
00223     }
00224   }
00225   if ( lim == NO_VALUE_SET ) { 
00226     if (d != destination.end()) {
00227       Destination & destin = d->second;
00228       std::map<std::string,Category>::iterator 
00229                       cd = destin.sev.find("default");
00230       if (cd != destin.sev.end()) {
00231         lim = cd->second.limit;
00232       } 
00233     }
00234   }     
00235   if ( lim == NO_VALUE_SET ) { 
00236     if (dd != destination.end()) {
00237       Destination & def_destin = dd->second;
00238       std::map<std::string,Category>::iterator 
00239                       cdd = def_destin.sev.find("default");
00240       if (cdd != def_destin.sev.end()) {
00241         lim = cdd->second.limit;
00242       } 
00243     }
00244   }     
00245   return lim;   
00246 } // sev_limit
00247 
00248 int 
00249 MessageLoggerDefaults::
00250 sev_reportEvery(std::string const & dest, std::string const & cat)
00251 {
00252   int re = NO_VALUE_SET;
00253   std::map<std::string,Destination>::iterator d = destination.find(dest);  
00254   if (d != destination.end()) {
00255     Destination & destin = d->second;
00256     std::map<std::string,Category>::iterator c = destin.sev.find(cat);
00257     if (c != destin.sev.end()) {
00258       re = c->second.reportEvery;
00259     } 
00260   }
00261   std::map<std::string,Destination>::iterator dd = destination.find("default");
00262   if ( re == NO_VALUE_SET ) { 
00263     if (dd != destination.end()) {
00264       Destination & def_destin = dd->second;
00265       std::map<std::string,Category>::iterator 
00266                       c = def_destin.sev.find(cat);
00267       if (c != def_destin.sev.end()) {
00268         re = c->second.reportEvery;
00269       } 
00270     }
00271   }
00272   if ( re == NO_VALUE_SET ) { 
00273     if (d != destination.end()) {
00274       Destination & destin = d->second;
00275       std::map<std::string,Category>::iterator 
00276                       cd = destin.sev.find("default");
00277       if (cd != destin.sev.end()) {
00278         re = cd->second.reportEvery;
00279       } 
00280     }
00281   }     
00282   if ( re == NO_VALUE_SET ) { 
00283     if (dd != destination.end()) {
00284       Destination & def_destin = dd->second;
00285       std::map<std::string,Category>::iterator 
00286                       cdd = def_destin.sev.find("default");
00287       if (cdd != def_destin.sev.end()) {
00288         re = cdd->second.reportEvery;
00289       } 
00290     }
00291   }     
00292   return re;   
00293 } // sev_reportEvery
00294 
00295 int 
00296 MessageLoggerDefaults::
00297 sev_timespan(std::string const & dest, std::string const & cat)
00298 {
00299   int tim = NO_VALUE_SET;
00300   std::map<std::string,Destination>::iterator d = destination.find(dest);  
00301   if (d != destination.end()) {
00302     Destination & destin = d->second;
00303     std::map<std::string,Category>::iterator c = destin.sev.find(cat);
00304     if (c != destin.sev.end()) {
00305       tim = c->second.timespan;
00306     } 
00307   }
00308   std::map<std::string,Destination>::iterator dd = destination.find("default");
00309   if ( tim == NO_VALUE_SET ) { 
00310     if (dd != destination.end()) {
00311       Destination & def_destin = dd->second;
00312       std::map<std::string,Category>::iterator 
00313                       c = def_destin.sev.find(cat);
00314       if (c != def_destin.sev.end()) {
00315         tim = c->second.timespan;
00316       } 
00317     }
00318   }
00319   if ( tim == NO_VALUE_SET ) { 
00320     if (d != destination.end()) {
00321       Destination & destin = d->second;
00322       std::map<std::string,Category>::iterator 
00323                       cd = destin.sev.find("default");
00324       if (cd != destin.sev.end()) {
00325         tim = cd->second.timespan;
00326       } 
00327     }
00328   }     
00329   if ( tim == NO_VALUE_SET ) { 
00330     if (dd != destination.end()) {
00331       Destination & def_destin = dd->second;
00332       std::map<std::string,Category>::iterator 
00333                       cdd = def_destin.sev.find("default");
00334       if (cdd != def_destin.sev.end()) {
00335         tim = cdd->second.timespan;
00336       } 
00337     }
00338   }     
00339   return tim;   
00340 } // sev_timespan
00341 
00342 
00343 
00344 
00345 } // end of namespace service  
00346 } // end of namespace edm  
00347