CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/FWCore/MessageService/src/HardwiredDefaults.cc

Go to the documentation of this file.
00001 // ----------------------------------------------------------------------
00002 //
00003 // HardwiredDefaults.cc
00004 //
00005 // All the hardwired defaults, organized by which JobMode they apply to
00006 //
00007 // JobModes:  
00008 //      JobModeGrid
00009 //      JobModeAnalysis
00010 //
00011 // Initial Version:  mf 6/18/07
00012 //
00013 // Changes:
00014 //
00015 // 7/7/08   mf  Statistics with different threshold (WARNING level)
00016 //
00017 // 7/10/08  mf  New mode:  infos --> ReleaseValidationJobMode
00018 //                      Statistics at INFO threshold
00019 //                      Default limit for INFO at 5 rather than 0
00020 //
00021 // ----------------------------------------------------------------------
00022 
00023 
00024 
00025 #include "FWCore/MessageService/interface/MessageLoggerDefaults.h"
00026 
00027 #include <iostream>
00028 
00029 namespace edm {
00030 namespace service {
00031 
00032 edm::JobMode 
00033 MessageLoggerDefaults::
00034 mode(std::string const & jm)
00035 {
00036   if (jm == "")           return       GridJobMode;  // no -mode option = grid
00037   if (jm == "grid")       return       GridJobMode;
00038   if (jm == "infos")      return       ReleaseValidationJobMode;
00039   if (jm == "analysis")   return       AnalysisJobMode;
00040   if (jm == "nil")        return       NilJobMode;
00041   std::cerr << "Unrecognized Job Mode Option: " << jm
00042             << " -- defaulting to analysis mode ";
00043   return AnalysisJobMode;
00044 }  
00045 
00046 void MessageLoggerDefaults::
00047 hardwireGridJobMode() 
00048 {
00049   //    std::cerr << " ======= hardwireGridJobMode() \n";
00050   destinations.push_back ( "cerr"              );
00051   categories.push_back   ( "FwkJob"            );
00052   categories.push_back   ( "FwkReport"         );
00053   categories.push_back   ( "FwkSummary"        );
00054   categories.push_back   ( "Root_NoDictionary" );
00055   statistics.push_back   ( "cerr_stats"        );
00056   // cerr destination - 
00057   //      note that using the name cerr is OK since it is not std::cerr
00058   //      but when we want to use default as a name, we have to be circumspect
00059   { Destination cerr;                     // PSet cerr
00060     cerr.threshold = "INFO";              // string threshold = "INFO"
00061     Category INFO_limits;                 // PSet INFO = { ... } 
00062       INFO_limits.limit = 0;              // int32 limit = 0
00063       cerr.sev["INFO"] = INFO_limits; 
00064     Category  default_for_dest;           // PSet default
00065       default_for_dest.limit = 10000000;  // int32 limit = 10000000
00066       cerr.category["default"] = default_for_dest;
00067     Category FwkReport;                   // PSet FwkReport
00068       FwkReport.limit = 10000000;         // int32 limit = 10000000
00069       FwkReport.reportEvery = 1;          // int32 reportEvery = 1
00070       cerr.category["FwkReport"] = FwkReport;
00071     Category FwkSummary;                  // PSet FwkSummary
00072       FwkSummary.limit = 10000000;        // int32 limit = 10000000
00073       FwkSummary.reportEvery = 1;         // int32 reportEvery = 1
00074       cerr.category["FwkSummary"] = FwkSummary;
00075     Category FwkJob;                      // PSet FwkJob
00076       FwkJob.limit = 0;                   // int32 limit = 0
00077       cerr.category["FwkJob"] = FwkJob;
00078      Category Root_NoDictionary;          // PSet Root_NoDictionary
00079       Root_NoDictionary.limit =  0;       // int32 limit = 0
00080       cerr.category["Root_NoDictionary"] = Root_NoDictionary;
00081     destination["cerr"] = cerr;
00082   }
00083   { Destination FrameworkJobReport;       // PSet FrameworkJobReport
00084     Category  default_for_dest;           // PSet default
00085       default_for_dest.limit = 0;         // int32 limit = 0
00086       FrameworkJobReport.category["default"] = default_for_dest;
00087     Category FwkJob;                      // PSet FwkJob
00088       FwkJob.limit = 10000000;            // int32 limit = 10000000
00089       FrameworkJobReport.category["FwkJob"] = FwkJob;
00090     destination["FrameworkJobReport"] = FrameworkJobReport;
00091   }
00092   { Destination cerr_stats;                      // PSet cerr_stats
00093     cerr_stats.threshold = "WARNING";            // string threshold = "WARNING"
00094     cerr_stats.output = "cerr";                  // string output = "cerr"
00095     destination["cerr_stats"] = cerr_stats;
00096   }
00097 
00098 } // hardwireGridJobMode
00099 
00100 void MessageLoggerDefaults::
00101 hardwireReleaseValidationJobMode() 
00102 {
00103   //    std::cerr << " ======= hardwireReleaseValidationJobMode() \n";
00104   destinations.push_back ( "cerr"              );
00105   categories.push_back   ( "FwkJob"            );
00106   categories.push_back   ( "FwkReport"         );
00107   categories.push_back   ( "FwkSummary"        );
00108   categories.push_back   ( "Root_NoDictionary" );
00109   statistics.push_back   ( "cerr_stats"        );
00110   // cerr destination - 
00111   //      note that using the name cerr is OK since it is not std::cerr
00112   //      but when we want to use default as a name, we have to be circumspect
00113   { Destination cerr;                     // PSet cerr
00114     cerr.threshold = "INFO";              // string threshold = "INFO"
00115     Category INFO_limits;                 // PSet INFO = { ... } 
00116       INFO_limits.limit = 5;              // int32 limit = 5
00117       cerr.sev["INFO"] = INFO_limits; 
00118     Category  default_for_dest;           // PSet default
00119       default_for_dest.limit = 10000000;  // int32 limit = 10000000
00120       cerr.category["default"] = default_for_dest;
00121     Category FwkReport;                   // PSet FwkReport
00122       FwkReport.limit = 10000000;         // int32 limit = 10000000
00123       FwkReport.reportEvery = 1;          // int32 reportEvery = 1
00124       cerr.category["FwkReport"] = FwkReport;
00125     Category FwkSummary;                  // PSet FwkSummary
00126       FwkSummary.limit = 10000000;        // int32 limit = 10000000
00127       FwkSummary.reportEvery = 1;         // int32 reportEvery = 1
00128       cerr.category["FwkSummary"] = FwkSummary;
00129     Category FwkJob;                      // PSet FwkJob
00130       FwkJob.limit = 0;                   // int32 limit = 0
00131       cerr.category["FwkJob"] = FwkJob;
00132      Category Root_NoDictionary;          // PSet Root_NoDictionary
00133       Root_NoDictionary.limit =  0;       // int32 limit = 0
00134       cerr.category["Root_NoDictionary"] = Root_NoDictionary;
00135     destination["cerr"] = cerr;
00136   }
00137   { Destination FrameworkJobReport;       // PSet FrameworkJobReport
00138     Category  default_for_dest;           // PSet default
00139       default_for_dest.limit = 0;         // int32 limit = 0
00140       FrameworkJobReport.category["default"] = default_for_dest;
00141     Category FwkJob;                      // PSet FwkJob
00142       FwkJob.limit = 10000000;            // int32 limit = 10000000
00143       FrameworkJobReport.category["FwkJob"] = FwkJob;
00144     destination["FrameworkJobReport"] = FrameworkJobReport;
00145   }
00146   { Destination cerr_stats;                      // PSet cerr_stats
00147     cerr_stats.threshold = "INFO";               // string threshold = "INFO"
00148     cerr_stats.output = "cerr";                  // string output = "cerr"
00149     destination["cerr_stats"] = cerr_stats;
00150   }
00151 
00152 } // hardwireReleaseValidationJobMode
00153 
00154 void MessageLoggerDefaults::
00155 hardwireAnalysisJobMode() 
00156 {
00157   //    std::cerr << " ======= hardwireAnalysisJobMode() \n";
00158   destinations.push_back ( "warnings"          );
00159   categories.push_back   ( "FwkJob"            );
00160   categories.push_back   ( "FwkReport"         );
00161   categories.push_back   ( "FwkSummary"        );
00162   categories.push_back   ( "Root_NoDictionary" );
00163   statistics.push_back   ( "cerr"              );
00164   // cerr destination - 
00165   //      note that using the name cerr is OK since it is not std::cerr
00166   //      but when we want to use default as a name, we have to be circumspect
00167   { Destination warnings;                 // PSet warnings
00168     warnings.threshold = "INFO";          // string threshold = "INFO"
00169     Category INFO_limits;                 // PSet INFO = { ... } 
00170       INFO_limits.limit = 0;              // int32 limit = 0
00171       warnings.sev["INFO"] = INFO_limits; 
00172     Category  default_for_dest;           // PSet default
00173       default_for_dest.limit = 1000    ;  // int32 limit = 1000
00174       warnings.category["default"] = default_for_dest;
00175     Category FwkReport;                   // PSet FwkReport
00176       FwkReport.limit = 10000000;         // int32 limit = 10000000
00177       FwkReport.reportEvery = 100;        // int32 reportEvery = 100
00178       warnings.category["FwkReport"] = FwkReport;
00179     Category FwkSummary;                  // PSet FwkSummary
00180       FwkSummary.limit = 10000000;        // int32 limit = 10000000
00181       warnings.category["FwkSummary"] = FwkSummary;
00182     Category FwkJob;                      // PSet FwkJob
00183       FwkJob.limit = 0;                   // int32 limit = 0
00184       warnings.category["FwkJob"] = FwkJob;
00185      Category Root_NoDictionary;          // PSet Root_NoDictionary
00186       Root_NoDictionary.limit =  0;       // int32 limit = 0
00187       warnings.category["Root_NoDictionary"] = Root_NoDictionary;
00188     destination["warnings"] = warnings;
00189   }
00190   { Destination cerr;                           // PSet cerr
00191     cerr.threshold = "INFO";                    // string threshold = "INFO"
00192     destination["cerr"] = cerr;
00193   }
00194 } // hardwireAnalysisJobMode
00195 
00196 void MessageLoggerDefaults::
00197 hardwireNilJobMode() 
00198 {
00199   //    std::cerr << " ======= hardwireNilJobMode() \n";
00200 } // hardwireNilJobMode
00201 
00202 
00203 } // end of namespace service  
00204 } // end of namespace edm  
00205