#include <MessageLoggerDefaults.h>
Classes | |
struct | Category |
struct | Destination |
Public Member Functions | |
void | hardwireAnalysisJobMode () |
void | hardwireGridJobMode () |
void | hardwireNilJobMode () |
void | hardwireReleaseValidationJobMode () |
int | limit (std::string const &dest, std::string const &cat) |
MessageLoggerDefaults (edm::JobMode mode=GridJobMode) | |
std::string | output (std::string const &dest) |
int | reportEvery (std::string const &dest, std::string const &cat) |
int | sev_limit (std::string const &dest, std::string const &sev) |
int | sev_reportEvery (std::string const &dest, std::string const &sev) |
int | sev_timespan (std::string const &dest, std::string const &sev) |
std::string | threshold (std::string const &dest) |
int | timespan (std::string const &dest, std::string const &cat) |
Static Public Member Functions | |
static edm::JobMode | mode (std::string const &jm) |
Public Attributes | |
std::vector< std::string > | categories |
std::map< std::string, Destination > | destination |
std::vector< std::string > | destinations |
std::vector< std::string > | fwkJobReports |
std::vector< std::string > | statistics |
Static Public Attributes | |
static const int | NO_VALUE_SET = -45654 |
Definition at line 70 of file MessageLoggerDefaults.h.
edm::service::MessageLoggerDefaults::MessageLoggerDefaults | ( | edm::JobMode | mode = GridJobMode | ) | [inline, explicit] |
Definition at line 125 of file MessageLoggerDefaults.h.
References edm::AnalysisJobMode, edm::GridJobMode, hardwireAnalysisJobMode(), hardwireGridJobMode(), hardwireNilJobMode(), hardwireReleaseValidationJobMode(), mode(), edm::NilJobMode, and edm::ReleaseValidationJobMode.
{ // mode-independent defaults // mode-dependent defaults switch (mode) { // GridJobMode: Intended for automated batch-like processing, in which // the output stream for cerr is routed to an apropro // file. LogInfo messages are enabled, and at least // one such message is delivered from the framework per // event, so this mode is not suitable for many-Hz light // event processing. case GridJobMode: hardwireGridJobMode(); break; case ReleaseValidationJobMode: hardwireReleaseValidationJobMode(); break; case AnalysisJobMode: hardwireAnalysisJobMode(); break; case NilJobMode: hardwireNilJobMode(); break; default: // this should never happen! No user error can get here. bool Invalid_JobMode_in_ctor_of_MessageLoggerDefaults = false; assert (Invalid_JobMode_in_ctor_of_MessageLoggerDefaults); } // end of switch on mode }
void MessageLoggerDefaults::hardwireAnalysisJobMode | ( | ) |
Definition at line 155 of file HardwiredDefaults.cc.
References categories, edm::service::MessageLoggerDefaults::Destination::category, dtNoiseDBValidation_cfg::cerr, destination, destinations, edm::service::MessageLoggerDefaults::Category::limit, edm::service::MessageLoggerDefaults::Category::reportEvery, edm::service::MessageLoggerDefaults::Destination::sev, statistics, edm::service::MessageLoggerDefaults::Destination::threshold, and benchmark_cfg::warnings.
Referenced by MessageLoggerDefaults().
{ // std::cerr << " ======= hardwireAnalysisJobMode() \n"; destinations.push_back ( "warnings" ); categories.push_back ( "FwkJob" ); categories.push_back ( "FwkReport" ); categories.push_back ( "FwkSummary" ); categories.push_back ( "Root_NoDictionary" ); statistics.push_back ( "cerr" ); // cerr destination - // note that using the name cerr is OK since it is not std::cerr // but when we want to use default as a name, we have to be circumspect { Destination warnings; // PSet warnings warnings.threshold = "INFO"; // string threshold = "INFO" Category INFO_limits; // PSet INFO = { ... } INFO_limits.limit = 0; // int32 limit = 0 warnings.sev["INFO"] = INFO_limits; Category default_for_dest; // PSet default default_for_dest.limit = 1000 ; // int32 limit = 1000 warnings.category["default"] = default_for_dest; Category FwkReport; // PSet FwkReport FwkReport.limit = 10000000; // int32 limit = 10000000 FwkReport.reportEvery = 100; // int32 reportEvery = 100 warnings.category["FwkReport"] = FwkReport; Category FwkSummary; // PSet FwkSummary FwkSummary.limit = 10000000; // int32 limit = 10000000 warnings.category["FwkSummary"] = FwkSummary; Category FwkJob; // PSet FwkJob FwkJob.limit = 0; // int32 limit = 0 warnings.category["FwkJob"] = FwkJob; Category Root_NoDictionary; // PSet Root_NoDictionary Root_NoDictionary.limit = 0; // int32 limit = 0 warnings.category["Root_NoDictionary"] = Root_NoDictionary; destination["warnings"] = warnings; } { Destination cerr; // PSet cerr cerr.threshold = "INFO"; // string threshold = "INFO" destination["cerr"] = cerr; } } // hardwireAnalysisJobMode
void MessageLoggerDefaults::hardwireGridJobMode | ( | ) |
Definition at line 47 of file HardwiredDefaults.cc.
References categories, edm::service::MessageLoggerDefaults::Destination::category, dtNoiseDBValidation_cfg::cerr, benchmark_cfg::cerr_stats, destination, destinations, benchmark_cfg::FrameworkJobReport, edm::service::MessageLoggerDefaults::Category::limit, edm::service::MessageLoggerDefaults::Destination::output, edm::service::MessageLoggerDefaults::Category::reportEvery, edm::service::MessageLoggerDefaults::Destination::sev, statistics, and edm::service::MessageLoggerDefaults::Destination::threshold.
Referenced by MessageLoggerDefaults().
{ // std::cerr << " ======= hardwireGridJobMode() \n"; destinations.push_back ( "cerr" ); categories.push_back ( "FwkJob" ); categories.push_back ( "FwkReport" ); categories.push_back ( "FwkSummary" ); categories.push_back ( "Root_NoDictionary" ); statistics.push_back ( "cerr_stats" ); // cerr destination - // note that using the name cerr is OK since it is not std::cerr // but when we want to use default as a name, we have to be circumspect { Destination cerr; // PSet cerr cerr.threshold = "INFO"; // string threshold = "INFO" Category INFO_limits; // PSet INFO = { ... } INFO_limits.limit = 0; // int32 limit = 0 cerr.sev["INFO"] = INFO_limits; Category default_for_dest; // PSet default default_for_dest.limit = 10000000; // int32 limit = 10000000 cerr.category["default"] = default_for_dest; Category FwkReport; // PSet FwkReport FwkReport.limit = 10000000; // int32 limit = 10000000 FwkReport.reportEvery = 1; // int32 reportEvery = 1 cerr.category["FwkReport"] = FwkReport; Category FwkSummary; // PSet FwkSummary FwkSummary.limit = 10000000; // int32 limit = 10000000 FwkSummary.reportEvery = 1; // int32 reportEvery = 1 cerr.category["FwkSummary"] = FwkSummary; Category FwkJob; // PSet FwkJob FwkJob.limit = 0; // int32 limit = 0 cerr.category["FwkJob"] = FwkJob; Category Root_NoDictionary; // PSet Root_NoDictionary Root_NoDictionary.limit = 0; // int32 limit = 0 cerr.category["Root_NoDictionary"] = Root_NoDictionary; destination["cerr"] = cerr; } { Destination FrameworkJobReport; // PSet FrameworkJobReport Category default_for_dest; // PSet default default_for_dest.limit = 0; // int32 limit = 0 FrameworkJobReport.category["default"] = default_for_dest; Category FwkJob; // PSet FwkJob FwkJob.limit = 10000000; // int32 limit = 10000000 FrameworkJobReport.category["FwkJob"] = FwkJob; destination["FrameworkJobReport"] = FrameworkJobReport; } { Destination cerr_stats; // PSet cerr_stats cerr_stats.threshold = "WARNING"; // string threshold = "WARNING" cerr_stats.output = "cerr"; // string output = "cerr" destination["cerr_stats"] = cerr_stats; } } // hardwireGridJobMode
void MessageLoggerDefaults::hardwireNilJobMode | ( | ) |
Definition at line 197 of file HardwiredDefaults.cc.
Referenced by MessageLoggerDefaults().
{ // std::cerr << " ======= hardwireNilJobMode() \n"; } // hardwireNilJobMode
void MessageLoggerDefaults::hardwireReleaseValidationJobMode | ( | ) |
Definition at line 101 of file HardwiredDefaults.cc.
References categories, edm::service::MessageLoggerDefaults::Destination::category, dtNoiseDBValidation_cfg::cerr, benchmark_cfg::cerr_stats, destination, destinations, benchmark_cfg::FrameworkJobReport, edm::service::MessageLoggerDefaults::Category::limit, edm::service::MessageLoggerDefaults::Destination::output, edm::service::MessageLoggerDefaults::Category::reportEvery, edm::service::MessageLoggerDefaults::Destination::sev, statistics, and edm::service::MessageLoggerDefaults::Destination::threshold.
Referenced by MessageLoggerDefaults().
{ // std::cerr << " ======= hardwireReleaseValidationJobMode() \n"; destinations.push_back ( "cerr" ); categories.push_back ( "FwkJob" ); categories.push_back ( "FwkReport" ); categories.push_back ( "FwkSummary" ); categories.push_back ( "Root_NoDictionary" ); statistics.push_back ( "cerr_stats" ); // cerr destination - // note that using the name cerr is OK since it is not std::cerr // but when we want to use default as a name, we have to be circumspect { Destination cerr; // PSet cerr cerr.threshold = "INFO"; // string threshold = "INFO" Category INFO_limits; // PSet INFO = { ... } INFO_limits.limit = 5; // int32 limit = 5 cerr.sev["INFO"] = INFO_limits; Category default_for_dest; // PSet default default_for_dest.limit = 10000000; // int32 limit = 10000000 cerr.category["default"] = default_for_dest; Category FwkReport; // PSet FwkReport FwkReport.limit = 10000000; // int32 limit = 10000000 FwkReport.reportEvery = 1; // int32 reportEvery = 1 cerr.category["FwkReport"] = FwkReport; Category FwkSummary; // PSet FwkSummary FwkSummary.limit = 10000000; // int32 limit = 10000000 FwkSummary.reportEvery = 1; // int32 reportEvery = 1 cerr.category["FwkSummary"] = FwkSummary; Category FwkJob; // PSet FwkJob FwkJob.limit = 0; // int32 limit = 0 cerr.category["FwkJob"] = FwkJob; Category Root_NoDictionary; // PSet Root_NoDictionary Root_NoDictionary.limit = 0; // int32 limit = 0 cerr.category["Root_NoDictionary"] = Root_NoDictionary; destination["cerr"] = cerr; } { Destination FrameworkJobReport; // PSet FrameworkJobReport Category default_for_dest; // PSet default default_for_dest.limit = 0; // int32 limit = 0 FrameworkJobReport.category["default"] = default_for_dest; Category FwkJob; // PSet FwkJob FwkJob.limit = 10000000; // int32 limit = 10000000 FrameworkJobReport.category["FwkJob"] = FwkJob; destination["FrameworkJobReport"] = FrameworkJobReport; } { Destination cerr_stats; // PSet cerr_stats cerr_stats.threshold = "INFO"; // string threshold = "INFO" cerr_stats.output = "cerr"; // string output = "cerr" destination["cerr_stats"] = cerr_stats; } } // hardwireReleaseValidationJobMode
int MessageLoggerDefaults::limit | ( | std::string const & | dest, |
std::string const & | cat | ||
) |
Definition at line 62 of file MessageLoggerDefaults.cc.
References trackerHits::c, edm::service::MessageLoggerDefaults::Destination::category, createTree::dd, destination, and NO_VALUE_SET.
{ int lim = NO_VALUE_SET; std::map<std::string,Destination>::iterator d = destination.find(dest); if (d != destination.end()) { Destination & destin = d->second; std::map<std::string,Category>::iterator c = destin.category.find(cat); if (c != destin.category.end()) { lim = c->second.limit; } } std::map<std::string,Destination>::iterator dd = destination.find("default"); if ( lim == NO_VALUE_SET ) { if (dd != destination.end()) { Destination & def_destin = dd->second; std::map<std::string,Category>::iterator c = def_destin.category.find(cat); if (c != def_destin.category.end()) { lim = c->second.limit; } } } if ( lim == NO_VALUE_SET ) { if (d != destination.end()) { Destination & destin = d->second; std::map<std::string,Category>::iterator cd = destin.category.find("default"); if (cd != destin.category.end()) { lim = cd->second.limit; } } } if ( lim == NO_VALUE_SET ) { if (dd != destination.end()) { Destination & def_destin = dd->second; std::map<std::string,Category>::iterator cdd = def_destin.category.find("default"); if (cdd != def_destin.category.end()) { lim = cdd->second.limit; } } } return lim; } // limit
edm::JobMode MessageLoggerDefaults::mode | ( | std::string const & | jm | ) | [static] |
Definition at line 34 of file HardwiredDefaults.cc.
References edm::AnalysisJobMode, dtNoiseDBValidation_cfg::cerr, edm::GridJobMode, edm::NilJobMode, and edm::ReleaseValidationJobMode.
Referenced by MessageLoggerDefaults().
{ if (jm == "") return GridJobMode; // no -mode option = grid if (jm == "grid") return GridJobMode; if (jm == "infos") return ReleaseValidationJobMode; if (jm == "analysis") return AnalysisJobMode; if (jm == "nil") return NilJobMode; std::cerr << "Unrecognized Job Mode Option: " << jm << " -- defaulting to analysis mode "; return AnalysisJobMode; }
std::string MessageLoggerDefaults::output | ( | std::string const & | dest | ) |
Definition at line 48 of file MessageLoggerDefaults.cc.
References destination, edm::service::MessageLoggerDefaults::Destination::output, and AlCaHLTBitMon_QueryRunRegistry::string.
{ std::string otpt = ""; std::map<std::string,Destination>::iterator d = destination.find(dest); if (d != destination.end()) { Destination & destin = d->second; otpt = destin.output; } // There is no default output; so if we did not find the dest, then return "" return otpt; } // output
int MessageLoggerDefaults::reportEvery | ( | std::string const & | dest, |
std::string const & | cat | ||
) |
Definition at line 109 of file MessageLoggerDefaults.cc.
References trackerHits::c, edm::service::MessageLoggerDefaults::Destination::category, createTree::dd, destination, and NO_VALUE_SET.
{ int re = NO_VALUE_SET; std::map<std::string,Destination>::iterator d = destination.find(dest); if (d != destination.end()) { Destination & destin = d->second; std::map<std::string,Category>::iterator c = destin.category.find(cat); if (c != destin.category.end()) { re = c->second.reportEvery; } } std::map<std::string,Destination>::iterator dd = destination.find("default"); if ( re == NO_VALUE_SET ) { if (dd != destination.end()) { Destination & def_destin = dd->second; std::map<std::string,Category>::iterator c = def_destin.category.find(cat); if (c != def_destin.category.end()) { re = c->second.reportEvery; } } } if ( re == NO_VALUE_SET ) { if (d != destination.end()) { Destination & destin = d->second; std::map<std::string,Category>::iterator cd = destin.category.find("default"); if (cd != destin.category.end()) { re = cd->second.reportEvery; } } } if ( re == NO_VALUE_SET ) { if (dd != destination.end()) { Destination & def_destin = dd->second; std::map<std::string,Category>::iterator cdd = def_destin.category.find("default"); if (cdd != def_destin.category.end()) { re = cdd->second.reportEvery; } } } return re; } // reportEvery
int MessageLoggerDefaults::sev_limit | ( | std::string const & | dest, |
std::string const & | sev | ||
) |
Definition at line 203 of file MessageLoggerDefaults.cc.
References trackerHits::c, createTree::dd, destination, NO_VALUE_SET, and edm::service::MessageLoggerDefaults::Destination::sev.
{ int lim = NO_VALUE_SET; std::map<std::string,Destination>::iterator d = destination.find(dest); if (d != destination.end()) { Destination & destin = d->second; std::map<std::string,Category>::iterator c = destin.sev.find(cat); if (c != destin.sev.end()) { lim = c->second.limit; } } std::map<std::string,Destination>::iterator dd = destination.find("default"); if ( lim == NO_VALUE_SET ) { if (dd != destination.end()) { Destination & def_destin = dd->second; std::map<std::string,Category>::iterator c = def_destin.sev.find(cat); if (c != def_destin.sev.end()) { lim = c->second.limit; } } } if ( lim == NO_VALUE_SET ) { if (d != destination.end()) { Destination & destin = d->second; std::map<std::string,Category>::iterator cd = destin.sev.find("default"); if (cd != destin.sev.end()) { lim = cd->second.limit; } } } if ( lim == NO_VALUE_SET ) { if (dd != destination.end()) { Destination & def_destin = dd->second; std::map<std::string,Category>::iterator cdd = def_destin.sev.find("default"); if (cdd != def_destin.sev.end()) { lim = cdd->second.limit; } } } return lim; } // sev_limit
int MessageLoggerDefaults::sev_reportEvery | ( | std::string const & | dest, |
std::string const & | sev | ||
) |
Definition at line 250 of file MessageLoggerDefaults.cc.
References trackerHits::c, createTree::dd, destination, NO_VALUE_SET, and edm::service::MessageLoggerDefaults::Destination::sev.
{ int re = NO_VALUE_SET; std::map<std::string,Destination>::iterator d = destination.find(dest); if (d != destination.end()) { Destination & destin = d->second; std::map<std::string,Category>::iterator c = destin.sev.find(cat); if (c != destin.sev.end()) { re = c->second.reportEvery; } } std::map<std::string,Destination>::iterator dd = destination.find("default"); if ( re == NO_VALUE_SET ) { if (dd != destination.end()) { Destination & def_destin = dd->second; std::map<std::string,Category>::iterator c = def_destin.sev.find(cat); if (c != def_destin.sev.end()) { re = c->second.reportEvery; } } } if ( re == NO_VALUE_SET ) { if (d != destination.end()) { Destination & destin = d->second; std::map<std::string,Category>::iterator cd = destin.sev.find("default"); if (cd != destin.sev.end()) { re = cd->second.reportEvery; } } } if ( re == NO_VALUE_SET ) { if (dd != destination.end()) { Destination & def_destin = dd->second; std::map<std::string,Category>::iterator cdd = def_destin.sev.find("default"); if (cdd != def_destin.sev.end()) { re = cdd->second.reportEvery; } } } return re; } // sev_reportEvery
int MessageLoggerDefaults::sev_timespan | ( | std::string const & | dest, |
std::string const & | sev | ||
) |
Definition at line 297 of file MessageLoggerDefaults.cc.
References trackerHits::c, createTree::dd, destination, NO_VALUE_SET, and edm::service::MessageLoggerDefaults::Destination::sev.
{ int tim = NO_VALUE_SET; std::map<std::string,Destination>::iterator d = destination.find(dest); if (d != destination.end()) { Destination & destin = d->second; std::map<std::string,Category>::iterator c = destin.sev.find(cat); if (c != destin.sev.end()) { tim = c->second.timespan; } } std::map<std::string,Destination>::iterator dd = destination.find("default"); if ( tim == NO_VALUE_SET ) { if (dd != destination.end()) { Destination & def_destin = dd->second; std::map<std::string,Category>::iterator c = def_destin.sev.find(cat); if (c != def_destin.sev.end()) { tim = c->second.timespan; } } } if ( tim == NO_VALUE_SET ) { if (d != destination.end()) { Destination & destin = d->second; std::map<std::string,Category>::iterator cd = destin.sev.find("default"); if (cd != destin.sev.end()) { tim = cd->second.timespan; } } } if ( tim == NO_VALUE_SET ) { if (dd != destination.end()) { Destination & def_destin = dd->second; std::map<std::string,Category>::iterator cdd = def_destin.sev.find("default"); if (cdd != def_destin.sev.end()) { tim = cdd->second.timespan; } } } return tim; } // sev_timespan
std::string MessageLoggerDefaults::threshold | ( | std::string const & | dest | ) |
Definition at line 28 of file MessageLoggerDefaults.cc.
References createTree::dd, destination, AlCaHLTBitMon_QueryRunRegistry::string, and edm::service::MessageLoggerDefaults::Destination::threshold.
{ std::string thr = ""; std::map<std::string,Destination>::iterator d = destination.find(dest); if (d != destination.end()) { Destination & destin = d->second; thr = destin.threshold; } std::map<std::string,Destination>::iterator dd = destination.find("default"); if ( thr == "" ) { if (dd != destination.end()) { Destination & def_destin = dd->second; thr = def_destin.threshold; } } return thr; } // threshold
int MessageLoggerDefaults::timespan | ( | std::string const & | dest, |
std::string const & | cat | ||
) |
Definition at line 156 of file MessageLoggerDefaults.cc.
References trackerHits::c, edm::service::MessageLoggerDefaults::Destination::category, createTree::dd, destination, and NO_VALUE_SET.
{ int tim = NO_VALUE_SET; std::map<std::string,Destination>::iterator d = destination.find(dest); if (d != destination.end()) { Destination & destin = d->second; std::map<std::string,Category>::iterator c = destin.category.find(cat); if (c != destin.category.end()) { tim = c->second.timespan; } } std::map<std::string,Destination>::iterator dd = destination.find("default"); if ( tim == NO_VALUE_SET ) { if (dd != destination.end()) { Destination & def_destin = dd->second; std::map<std::string,Category>::iterator c = def_destin.category.find(cat); if (c != def_destin.category.end()) { tim = c->second.timespan; } } } if ( tim == NO_VALUE_SET ) { if (d != destination.end()) { Destination & destin = d->second; std::map<std::string,Category>::iterator cd = destin.category.find("default"); if (cd != destin.category.end()) { tim = cd->second.timespan; } } } if ( tim == NO_VALUE_SET ) { if (dd != destination.end()) { Destination & def_destin = dd->second; std::map<std::string,Category>::iterator cdd = def_destin.category.find("default"); if (cdd != def_destin.category.end()) { tim = cdd->second.timespan; } } } return tim; } // timespan
std::vector<std::string> edm::service::MessageLoggerDefaults::categories |
Definition at line 95 of file MessageLoggerDefaults.h.
Referenced by hardwireAnalysisJobMode(), hardwireGridJobMode(), and hardwireReleaseValidationJobMode().
std::map<std::string,Destination> edm::service::MessageLoggerDefaults::destination |
Definition at line 99 of file MessageLoggerDefaults.h.
Referenced by hardwireAnalysisJobMode(), hardwireGridJobMode(), hardwireReleaseValidationJobMode(), limit(), output(), reportEvery(), sev_limit(), sev_reportEvery(), sev_timespan(), threshold(), and timespan().
std::vector<std::string> edm::service::MessageLoggerDefaults::destinations |
Definition at line 96 of file MessageLoggerDefaults.h.
Referenced by hardwireAnalysisJobMode(), hardwireGridJobMode(), and hardwireReleaseValidationJobMode().
std::vector<std::string> edm::service::MessageLoggerDefaults::fwkJobReports |
Definition at line 97 of file MessageLoggerDefaults.h.
const int edm::service::MessageLoggerDefaults::NO_VALUE_SET = -45654 [static] |
Definition at line 72 of file MessageLoggerDefaults.h.
Referenced by limit(), reportEvery(), sev_limit(), sev_reportEvery(), sev_timespan(), and timespan().
std::vector<std::string> edm::service::MessageLoggerDefaults::statistics |
Definition at line 98 of file MessageLoggerDefaults.h.
Referenced by hardwireAnalysisJobMode(), hardwireGridJobMode(), and hardwireReleaseValidationJobMode().