diff --git a/FWCore/Framework/test/test_deepCall_unscheduled_cfg.py b/FWCore/Framework/test/test_deepCall_unscheduled_cfg.py index 2f0765b66033b..2235712d199d7 100644 --- a/FWCore/Framework/test/test_deepCall_unscheduled_cfg.py +++ b/FWCore/Framework/test/test_deepCall_unscheduled_cfg.py @@ -23,13 +23,11 @@ ) process.MessageLogger = cms.Service("MessageLogger", - destinations = cms.untracked.vstring('cout', - 'cerr' - ), - categories = cms.untracked.vstring( - 'Tracer' + cerr = cms.untracked.PSet( + enableStatistics = cms.untracked.bool(False) ), cout = cms.untracked.PSet( + enable = cms.untracked.bool(True), default = cms.untracked.PSet ( limit = cms.untracked.int32(0) ), diff --git a/FWCore/MessageService/src/ELadministrator.h b/FWCore/MessageService/src/ELadministrator.h index e2c834ce29ec2..ae825a4783764 100644 --- a/FWCore/MessageService/src/ELadministrator.h +++ b/FWCore/MessageService/src/ELadministrator.h @@ -59,27 +59,13 @@ namespace edm { namespace service { - // ---------------------------------------------------------------------- - // Prerequisite classes: - // ---------------------------------------------------------------------- - - class ELdestination; - class ELcout; - class MessageLoggerScribe; - // ---------------------------------------------------------------------- // ELadministrator: // ---------------------------------------------------------------------- - class ELadministrator { // *** Destructable Singleton Pattern *** - - friend class MessageLoggerScribe; // proper ELadministrator cleanup - friend class ThreadSafeLogMessageLoggerScribe; // proper ELadministrator cleanup - friend class ELcout; // ELcout behavior - - // *** Error Logger Functionality *** - + class ELadministrator { public: + ELadministrator(); ~ELadministrator(); //Replaces ErrorLog which is no longer needed @@ -118,11 +104,6 @@ namespace edm { const ELseverityLevel& highSeverity() const; int severityCounts(int lev) const; - protected: - // --- traditional birth/death, but disallowed to users: - // - ELadministrator(); - private: // --- traditional member data: // diff --git a/FWCore/MessageService/src/MessageLoggerDefaults.cc b/FWCore/MessageService/src/MessageLoggerDefaults.cc index e86f3ddb30df6..ccfd14fca209a 100644 --- a/FWCore/MessageService/src/MessageLoggerDefaults.cc +++ b/FWCore/MessageService/src/MessageLoggerDefaults.cc @@ -21,49 +21,49 @@ namespace edm { namespace service { - std::string MessageLoggerDefaults::threshold(std::string const& dest) { + std::string MessageLoggerDefaults::threshold(std::string const& dest) const { std::string thr = ""; - std::map::iterator d = destination.find(dest); + auto d = destination.find(dest); if (d != destination.end()) { - Destination& destin = d->second; + auto const& destin = d->second; thr = destin.threshold; } - std::map::iterator dd = destination.find("default"); + auto dd = destination.find("default"); if (thr.empty()) { if (dd != destination.end()) { - Destination& def_destin = dd->second; + auto const& def_destin = dd->second; thr = def_destin.threshold; } } return thr; } // threshold - std::string MessageLoggerDefaults::output(std::string const& dest) { + std::string MessageLoggerDefaults::output(std::string const& dest) const { std::string otpt = ""; - std::map::iterator d = destination.find(dest); + auto d = destination.find(dest); if (d != destination.end()) { - Destination& destin = d->second; + auto const& 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::limit(std::string const& dest, std::string const& cat) { + int MessageLoggerDefaults::limit(std::string const& dest, std::string const& cat) const { int lim = NO_VALUE_SET; - std::map::iterator d = destination.find(dest); + auto d = destination.find(dest); if (d != destination.end()) { - Destination& destin = d->second; - std::map::iterator c = destin.category.find(cat); + auto const& destin = d->second; + auto c = destin.category.find(cat); if (c != destin.category.end()) { lim = c->second.limit; } } - std::map::iterator dd = destination.find("default"); + auto dd = destination.find("default"); if (lim == NO_VALUE_SET) { if (dd != destination.end()) { - Destination& def_destin = dd->second; - std::map::iterator c = def_destin.category.find(cat); + auto const& def_destin = dd->second; + auto c = def_destin.category.find(cat); if (c != def_destin.category.end()) { lim = c->second.limit; } @@ -71,8 +71,8 @@ namespace edm { } if (lim == NO_VALUE_SET) { if (d != destination.end()) { - Destination& destin = d->second; - std::map::iterator cd = destin.category.find("default"); + auto const& destin = d->second; + auto cd = destin.category.find("default"); if (cd != destin.category.end()) { lim = cd->second.limit; } @@ -80,8 +80,8 @@ namespace edm { } if (lim == NO_VALUE_SET) { if (dd != destination.end()) { - Destination& def_destin = dd->second; - std::map::iterator cdd = def_destin.category.find("default"); + auto const& def_destin = dd->second; + auto cdd = def_destin.category.find("default"); if (cdd != def_destin.category.end()) { lim = cdd->second.limit; } @@ -90,21 +90,21 @@ namespace edm { return lim; } // limit - int MessageLoggerDefaults::reportEvery(std::string const& dest, std::string const& cat) { + int MessageLoggerDefaults::reportEvery(std::string const& dest, std::string const& cat) const { int re = NO_VALUE_SET; - std::map::iterator d = destination.find(dest); + auto d = destination.find(dest); if (d != destination.end()) { - Destination& destin = d->second; - std::map::iterator c = destin.category.find(cat); + auto const& destin = d->second; + auto c = destin.category.find(cat); if (c != destin.category.end()) { re = c->second.reportEvery; } } - std::map::iterator dd = destination.find("default"); + auto dd = destination.find("default"); if (re == NO_VALUE_SET) { if (dd != destination.end()) { - Destination& def_destin = dd->second; - std::map::iterator c = def_destin.category.find(cat); + auto const& def_destin = dd->second; + auto c = def_destin.category.find(cat); if (c != def_destin.category.end()) { re = c->second.reportEvery; } @@ -112,8 +112,8 @@ namespace edm { } if (re == NO_VALUE_SET) { if (d != destination.end()) { - Destination& destin = d->second; - std::map::iterator cd = destin.category.find("default"); + auto const& destin = d->second; + auto cd = destin.category.find("default"); if (cd != destin.category.end()) { re = cd->second.reportEvery; } @@ -121,8 +121,8 @@ namespace edm { } if (re == NO_VALUE_SET) { if (dd != destination.end()) { - Destination& def_destin = dd->second; - std::map::iterator cdd = def_destin.category.find("default"); + auto const& def_destin = dd->second; + auto cdd = def_destin.category.find("default"); if (cdd != def_destin.category.end()) { re = cdd->second.reportEvery; } @@ -131,21 +131,21 @@ namespace edm { return re; } // reportEvery - int MessageLoggerDefaults::timespan(std::string const& dest, std::string const& cat) { + int MessageLoggerDefaults::timespan(std::string const& dest, std::string const& cat) const { int tim = NO_VALUE_SET; - std::map::iterator d = destination.find(dest); + auto d = destination.find(dest); if (d != destination.end()) { - Destination& destin = d->second; - std::map::iterator c = destin.category.find(cat); + auto const& destin = d->second; + auto c = destin.category.find(cat); if (c != destin.category.end()) { tim = c->second.timespan; } } - std::map::iterator dd = destination.find("default"); + auto dd = destination.find("default"); if (tim == NO_VALUE_SET) { if (dd != destination.end()) { - Destination& def_destin = dd->second; - std::map::iterator c = def_destin.category.find(cat); + auto const& def_destin = dd->second; + auto c = def_destin.category.find(cat); if (c != def_destin.category.end()) { tim = c->second.timespan; } @@ -153,8 +153,8 @@ namespace edm { } if (tim == NO_VALUE_SET) { if (d != destination.end()) { - Destination& destin = d->second; - std::map::iterator cd = destin.category.find("default"); + auto const& destin = d->second; + auto cd = destin.category.find("default"); if (cd != destin.category.end()) { tim = cd->second.timespan; } @@ -162,8 +162,8 @@ namespace edm { } if (tim == NO_VALUE_SET) { if (dd != destination.end()) { - Destination& def_destin = dd->second; - std::map::iterator cdd = def_destin.category.find("default"); + auto const& def_destin = dd->second; + auto cdd = def_destin.category.find("default"); if (cdd != def_destin.category.end()) { tim = cdd->second.timespan; } @@ -172,21 +172,21 @@ namespace edm { return tim; } // timespan - int MessageLoggerDefaults::sev_limit(std::string const& dest, std::string const& cat) { + int MessageLoggerDefaults::sev_limit(std::string const& dest, std::string const& cat) const { int lim = NO_VALUE_SET; - std::map::iterator d = destination.find(dest); + auto d = destination.find(dest); if (d != destination.end()) { - Destination& destin = d->second; - std::map::iterator c = destin.sev.find(cat); + auto const& destin = d->second; + auto c = destin.sev.find(cat); if (c != destin.sev.end()) { lim = c->second.limit; } } - std::map::iterator dd = destination.find("default"); + auto dd = destination.find("default"); if (lim == NO_VALUE_SET) { if (dd != destination.end()) { - Destination& def_destin = dd->second; - std::map::iterator c = def_destin.sev.find(cat); + auto const& def_destin = dd->second; + auto c = def_destin.sev.find(cat); if (c != def_destin.sev.end()) { lim = c->second.limit; } @@ -194,8 +194,8 @@ namespace edm { } if (lim == NO_VALUE_SET) { if (d != destination.end()) { - Destination& destin = d->second; - std::map::iterator cd = destin.sev.find("default"); + auto const& destin = d->second; + auto cd = destin.sev.find("default"); if (cd != destin.sev.end()) { lim = cd->second.limit; } @@ -203,8 +203,8 @@ namespace edm { } if (lim == NO_VALUE_SET) { if (dd != destination.end()) { - Destination& def_destin = dd->second; - std::map::iterator cdd = def_destin.sev.find("default"); + auto const& def_destin = dd->second; + auto cdd = def_destin.sev.find("default"); if (cdd != def_destin.sev.end()) { lim = cdd->second.limit; } @@ -213,21 +213,21 @@ namespace edm { return lim; } // sev_limit - int MessageLoggerDefaults::sev_reportEvery(std::string const& dest, std::string const& cat) { + int MessageLoggerDefaults::sev_reportEvery(std::string const& dest, std::string const& cat) const { int re = NO_VALUE_SET; - std::map::iterator d = destination.find(dest); + auto d = destination.find(dest); if (d != destination.end()) { - Destination& destin = d->second; - std::map::iterator c = destin.sev.find(cat); + auto const& destin = d->second; + auto c = destin.sev.find(cat); if (c != destin.sev.end()) { re = c->second.reportEvery; } } - std::map::iterator dd = destination.find("default"); + auto dd = destination.find("default"); if (re == NO_VALUE_SET) { if (dd != destination.end()) { - Destination& def_destin = dd->second; - std::map::iterator c = def_destin.sev.find(cat); + auto const& def_destin = dd->second; + auto c = def_destin.sev.find(cat); if (c != def_destin.sev.end()) { re = c->second.reportEvery; } @@ -235,8 +235,8 @@ namespace edm { } if (re == NO_VALUE_SET) { if (d != destination.end()) { - Destination& destin = d->second; - std::map::iterator cd = destin.sev.find("default"); + auto const& destin = d->second; + auto cd = destin.sev.find("default"); if (cd != destin.sev.end()) { re = cd->second.reportEvery; } @@ -244,8 +244,8 @@ namespace edm { } if (re == NO_VALUE_SET) { if (dd != destination.end()) { - Destination& def_destin = dd->second; - std::map::iterator cdd = def_destin.sev.find("default"); + auto const& def_destin = dd->second; + auto cdd = def_destin.sev.find("default"); if (cdd != def_destin.sev.end()) { re = cdd->second.reportEvery; } @@ -254,21 +254,21 @@ namespace edm { return re; } // sev_reportEvery - int MessageLoggerDefaults::sev_timespan(std::string const& dest, std::string const& cat) { + int MessageLoggerDefaults::sev_timespan(std::string const& dest, std::string const& cat) const { int tim = NO_VALUE_SET; - std::map::iterator d = destination.find(dest); + auto d = destination.find(dest); if (d != destination.end()) { - Destination& destin = d->second; - std::map::iterator c = destin.sev.find(cat); + auto const& destin = d->second; + auto c = destin.sev.find(cat); if (c != destin.sev.end()) { tim = c->second.timespan; } } - std::map::iterator dd = destination.find("default"); + auto dd = destination.find("default"); if (tim == NO_VALUE_SET) { if (dd != destination.end()) { - Destination& def_destin = dd->second; - std::map::iterator c = def_destin.sev.find(cat); + auto const& def_destin = dd->second; + auto c = def_destin.sev.find(cat); if (c != def_destin.sev.end()) { tim = c->second.timespan; } @@ -276,8 +276,8 @@ namespace edm { } if (tim == NO_VALUE_SET) { if (d != destination.end()) { - Destination& destin = d->second; - std::map::iterator cd = destin.sev.find("default"); + auto const& destin = d->second; + auto cd = destin.sev.find("default"); if (cd != destin.sev.end()) { tim = cd->second.timespan; } @@ -285,8 +285,8 @@ namespace edm { } if (tim == NO_VALUE_SET) { if (dd != destination.end()) { - Destination& def_destin = dd->second; - std::map::iterator cdd = def_destin.sev.find("default"); + auto const& def_destin = dd->second; + auto cdd = def_destin.sev.find("default"); if (cdd != def_destin.sev.end()) { tim = cdd->second.timespan; } diff --git a/FWCore/MessageService/src/MessageLoggerDefaults.h b/FWCore/MessageService/src/MessageLoggerDefaults.h index 646e5f7be2411..645282e927e87 100644 --- a/FWCore/MessageService/src/MessageLoggerDefaults.h +++ b/FWCore/MessageService/src/MessageLoggerDefaults.h @@ -94,16 +94,16 @@ namespace edm { // access to values set - std::string threshold(std::string const& dest); - std::string output(std::string const& dest); + std::string threshold(std::string const& dest) const; + std::string output(std::string const& dest) const; - int limit(std::string const& dest, std::string const& cat); - int reportEvery(std::string const& dest, std::string const& cat); - int timespan(std::string const& dest, std::string const& cat); + int limit(std::string const& dest, std::string const& cat) const; + int reportEvery(std::string const& dest, std::string const& cat) const; + int timespan(std::string const& dest, std::string const& cat) const; - 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); + int sev_limit(std::string const& dest, std::string const& sev) const; + int sev_reportEvery(std::string const& dest, std::string const& sev) const; + int sev_timespan(std::string const& dest, std::string const& sev) const; // Modes with hardwired defaults diff --git a/FWCore/MessageService/src/MessageServicePSetValidation.cc b/FWCore/MessageService/src/MessageServicePSetValidation.cc index 13ffcb653f087..823aa76330833 100644 --- a/FWCore/MessageService/src/MessageServicePSetValidation.cc +++ b/FWCore/MessageService/src/MessageServicePSetValidation.cc @@ -27,10 +27,17 @@ namespace edm { std::string edm::service::MessageServicePSetValidation::operator()(ParameterSet const& pset) { messageLoggerPSet(pset); - return flaws.str(); + return flaws_.str(); } // operator() to validate the PSet passed in void edm::service::MessageServicePSetValidation::messageLoggerPSet(ParameterSet const& pset) { + // See if new config API is being used + if (pset.exists("files") or + (not(pset.exists("destinations") or pset.existsAs>("statistics", true) or + pset.existsAs>("statistics", false) or pset.exists("categories")))) { + return; + } + // Four types of material are allowed at the MessageLogger level: // PSet lists (such as destinations or categories // Suppression lists, such as SuppressInfo or debugModules @@ -82,82 +89,82 @@ namespace edm { // Append explanatory information if flaws were found - if (!flaws.str().empty()) { - flaws << "\nThe above are from MessageLogger configuration validation.\n" - << "In most cases, these involve lines that the logger configuration code\n" - << "would not process, but which the cfg creator obviously meant to have " - << "effect.\n"; + if (!flaws_.str().empty()) { + flaws_ << "\nThe above are from MessageLogger configuration validation.\n" + << "In most cases, these involve lines that the logger configuration code\n" + << "would not process, but which the cfg creator obviously meant to have " + << "effect.\n"; } } // messageLoggerPSet void edm::service::MessageServicePSetValidation::psetLists(ParameterSet const& pset) { - destinations = check(pset, "MessageLogger", "destinations"); - noDuplicates(destinations, "MessageLogger", "destinations"); - noKeywords(destinations, "MessageLogger", "destinations"); - noNonPSetUsage(pset, destinations, "MessageLogger", "destinations"); - // REMOVED: noCoutCerrClash(destinations,"MessageLogger", "destinations"); - - statistics = check(pset, "MessageLogger", "statistics"); - noDuplicates(statistics, "MessageLogger", "statistics"); - noKeywords(statistics, "MessageLogger", "statistics"); - noNonPSetUsage(pset, statistics, "MessageLogger", "statistics"); - - categories = check(pset, "MessageLogger", "categories"); - noDuplicates(categories, "MessageLogger", "categories"); - noKeywords(categories, "MessageLogger", "categories"); - noNonPSetUsage(pset, categories, "MessageLogger", "categories"); - noDuplicates(categories, destinations, "MessageLogger", "categories", "destinations"); - noDuplicates(categories, statistics, "MessageLogger", "categories", "statistics"); + destinations_ = check(pset, "MessageLogger", "destinations"); + noDuplicates(destinations_, "MessageLogger", "destinations"); + noKeywords(destinations_, "MessageLogger", "destinations"); + noNonPSetUsage(pset, destinations_, "MessageLogger", "destinations"); + // REMOVED: noCoutCerrClash(destinations_,"MessageLogger", "destinations"); + + statistics_ = check(pset, "MessageLogger", "statistics"); + noDuplicates(statistics_, "MessageLogger", "statistics"); + noKeywords(statistics_, "MessageLogger", "statistics"); + noNonPSetUsage(pset, statistics_, "MessageLogger", "statistics"); + + categories_ = check(pset, "MessageLogger", "categories"); + noDuplicates(categories_, "MessageLogger", "categories"); + noKeywords(categories_, "MessageLogger", "categories"); + noNonPSetUsage(pset, categories_, "MessageLogger", "categories"); + noDuplicates(categories_, destinations_, "MessageLogger", "categories", "destinations"); + noDuplicates(categories_, statistics_, "MessageLogger", "categories", "statistics"); } // psetLists void edm::service::MessageServicePSetValidation::suppressionLists(ParameterSet const& pset) { - debugModules = check(pset, "MessageLogger", "debugModules"); - bool dmStar = wildcard(debugModules); - if (dmStar && debugModules.size() != 1) { - flaws << "MessageLogger" - << " PSet: \n" - << "debugModules contains wildcard character *" - << " and also " << debugModules.size() - 1 << " other entries - * must be alone\n"; - } - suppressDebug = check(pset, "MessageLogger", "suppressDebug"); - if ((!suppressDebug.empty()) && (!dmStar)) { - flaws << "MessageLogger" - << " PSet: \n" - << "suppressDebug contains modules, but debugModules is not *\n" - << "Unless all the debugModules are enabled,\n" - << "suppressing specific modules is meaningless\n"; - } - if (wildcard(suppressDebug)) { - flaws << "MessageLogger" - << " PSet: \n" - << "Use of wildcard (*) in suppressDebug is not supported\n" - << "By default, LogDebug is suppressed for all modules\n"; - } - suppressInfo = check(pset, "MessageLogger", "suppressInfo"); - if (wildcard(suppressInfo)) { - flaws << "MessageLogger" - << " PSet: \n" - << "Use of wildcard (*) in suppressInfo is not supported\n"; - } - suppressFwkInfo = check(pset, "MessageLogger", "suppressFwkInfo"); - if (wildcard(suppressFwkInfo)) { - flaws << "MessageLogger" - << " PSet: \n" - << "Use of wildcard (*) in suppressFwkInfo is not supported\n"; - } - suppressWarning = check(pset, "MessageLogger", "suppressWarning"); - if (wildcard(suppressWarning)) { - flaws << "MessageLogger" - << " PSet: \n" - << "Use of wildcard (*) in suppressWarning is not supported\n"; - } - suppressError = check(pset, "MessageLogger", "suppressError"); - if (wildcard(suppressError)) { - flaws << "MessageLogger" - << " PSet: \n" - << "Use of wildcard (*) in suppressError is not supported\n"; + debugModules_ = check(pset, "MessageLogger", "debugModules"); + bool dmStar = wildcard(debugModules_); + if (dmStar && debugModules_.size() != 1) { + flaws_ << "MessageLogger" + << " PSet: \n" + << "debugModules contains wildcard character *" + << " and also " << debugModules_.size() - 1 << " other entries - * must be alone\n"; + } + suppressDebug_ = check(pset, "MessageLogger", "suppressDebug"); + if ((!suppressDebug_.empty()) && (!dmStar)) { + flaws_ << "MessageLogger" + << " PSet: \n" + << "suppressDebug contains modules, but debugModules is not *\n" + << "Unless all the debugModules are enabled,\n" + << "suppressing specific modules is meaningless\n"; + } + if (wildcard(suppressDebug_)) { + flaws_ << "MessageLogger" + << " PSet: \n" + << "Use of wildcard (*) in suppressDebug is not supported\n" + << "By default, LogDebug is suppressed for all modules\n"; + } + suppressInfo_ = check(pset, "MessageLogger", "suppressInfo"); + if (wildcard(suppressInfo_)) { + flaws_ << "MessageLogger" + << " PSet: \n" + << "Use of wildcard (*) in suppressInfo is not supported\n"; + } + suppressFwkInfo_ = check(pset, "MessageLogger", "suppressFwkInfo"); + if (wildcard(suppressFwkInfo_)) { + flaws_ << "MessageLogger" + << " PSet: \n" + << "Use of wildcard (*) in suppressFwkInfo is not supported\n"; + } + suppressWarning_ = check(pset, "MessageLogger", "suppressWarning"); + if (wildcard(suppressWarning_)) { + flaws_ << "MessageLogger" + << " PSet: \n" + << "Use of wildcard (*) in suppressWarning is not supported\n"; + } + suppressError_ = check(pset, "MessageLogger", "suppressError"); + if (wildcard(suppressError_)) { + flaws_ << "MessageLogger" + << " PSet: \n" + << "Use of wildcard (*) in suppressError is not supported\n"; } } // suppressionLists @@ -168,19 +175,19 @@ namespace edm { vString::const_iterator end = vStrings.end(); for (vString::const_iterator i = vStrings.begin(); i != end; ++i) { if (!allowedVstring(*i)) { - flaws << "MessageLogger" - << " PSet: \n" - << (*i) << " is used as a vstring, " - << "but no such vstring is recognized\n"; + flaws_ << "MessageLogger" + << " PSet: \n" + << (*i) << " is used as a vstring, " + << "but no such vstring is recognized\n"; } } vStrings = pset.getParameterNamesForType(true); end = vStrings.end(); for (vString::const_iterator i = vStrings.begin(); i != end; ++i) { - flaws << "MessageLogger" - << " PSet: \n" - << (*i) << " is used as a tracked vstring: " - << "tracked parameters not allowed here\n"; + flaws_ << "MessageLogger" + << " PSet: \n" + << (*i) << " is used as a tracked vstring: " + << "tracked parameters not allowed here\n"; } } // vStringsCheck @@ -212,8 +219,8 @@ namespace edm { std::string const& psetName) { if (checkThreshold(thresh)) return true; - flaws << psetName << " PSet: \n" - << "threshold has value " << thresh << " which is not among {DEBUG, INFO, FWKINFO, WARNING, ERROR}\n"; + flaws_ << psetName << " PSet: \n" + << "threshold has value " << thresh << " which is not among {DEBUG, INFO, FWKINFO, WARNING, ERROR}\n"; return false; } // validateThreshold @@ -238,8 +245,8 @@ namespace edm { for (vString::const_iterator i = v.begin(); i != end; ++i) { for (vString::const_iterator j = i + 1; j != end; ++j) { if (*i == *j) { - flaws << psetName << " PSet: \n" - << "in vString " << parameterLabel << " duplication of the string " << *i << "\n"; + flaws_ << psetName << " PSet: \n" + << "in vString " << parameterLabel << " duplication of the string " << *i << "\n"; } } } @@ -255,8 +262,8 @@ namespace edm { for (vString::const_iterator i = v1.begin(); i != end1; ++i) { for (vString::const_iterator j = v2.begin(); j != end2; ++j) { if (*i == *j) { - flaws << psetName << " PSet: \n" - << "in vStrings " << p1 << " and " << p2 << " duplication of the string " << *i << "\n"; + flaws_ << psetName << " PSet: \n" + << "in vStrings " << p1 << " and " << p2 << " duplication of the string " << *i << "\n"; } } } @@ -275,8 +282,8 @@ namespace edm { cerrPresent = true; } if (coutPresent && cerrPresent) { - flaws << psetName << " PSet: \n" - << "vString " << parameterLabel << " has both cout and cerr \n"; + flaws_ << psetName << " PSet: \n" + << "vString " << parameterLabel << " has both cout and cerr \n"; } } // noCoutCerrClash(v) @@ -286,8 +293,8 @@ namespace edm { vString::const_iterator end = v.end(); for (vString::const_iterator i = v.begin(); i != end; ++i) { if (!keywordCheck(*i)) { - flaws << psetName << " PSet: \n" - << "vString " << parameterLabel << " should not contain the keyword " << *i << "\n"; + flaws_ << psetName << " PSet: \n" + << "vString " << parameterLabel << " should not contain the keyword " << *i << "\n"; } } } // noKeywords(v) @@ -349,6 +356,12 @@ namespace edm { return false; if (word == "optionalPSet") return false; + if (word == "enableStatistics") + return false; + if (word == "statisticsThreshold") + return false; + if (word == "resetStatistics") + return false; return true; } // keywordCheck @@ -362,7 +375,7 @@ namespace edm { disallowedParam(pset, v, psetName, parameterLabel, "float"); disallowedParam(pset, v, psetName, parameterLabel, "double"); disallowedParam(pset, v, psetName, parameterLabel, "string"); - disallowedParam >(pset, v, psetName, parameterLabel, "vstring"); + disallowedParam>(pset, v, psetName, parameterLabel, "vstring"); } // noNonPSetUsage void edm::service::MessageServicePSetValidation::noBadParams(vString const& v, @@ -375,9 +388,9 @@ namespace edm { for (vString::const_iterator i = v.begin(); i != end1; ++i) { for (vString::const_iterator j = params.begin(); j != end2; ++j) { if (*i == *j) { - flaws << psetName << " PSet: \n" - << *i << " (listed in vstring " << parameterLabel << ")\n" - << "is used as a parameter of type " << type << " instead of as a PSet \n"; + flaws_ << psetName << " PSet: \n" + << *i << " (listed in vstring " << parameterLabel << ")\n" + << "is used as a parameter of type " << type << " instead of as a PSet \n"; } } } @@ -398,11 +411,11 @@ namespace edm { pset.getParameterSetNames(psnames, false); vString::const_iterator end = psnames.end(); for (vString::const_iterator i = psnames.begin(); i != end; ++i) { - if (lookForMatch(destinations, *i)) + if (lookForMatch(destinations_, *i)) continue; - if (lookForMatch(statistics, *i)) + if (lookForMatch(statistics_, *i)) continue; - if (lookForMatch(categories, *i)) + if (lookForMatch(categories_, *i)) continue; if ((*i) == "default") continue; @@ -416,18 +429,18 @@ namespace edm { } if (ok_optionalPSet) continue; - flaws << "MessageLogger " - << " PSet: \n" - << *i << " is an unrecognized name for a PSet\n"; + flaws_ << "MessageLogger " + << " PSet: \n" + << *i << " is an unrecognized name for a PSet\n"; } psnames.clear(); unsigned int n = pset.getParameterSetNames(psnames, true); if (n > 0) { end = psnames.end(); for (vString::const_iterator i = psnames.begin(); i != end; ++i) { - flaws << "MessageLogger " - << " PSet: \n" - << "PSet " << *i << " is tracked - not allowed\n"; + flaws_ << "MessageLogger " + << " PSet: \n" + << "PSet " << *i << " is tracked - not allowed\n"; } } } @@ -440,8 +453,8 @@ namespace edm { void edm::service::MessageServicePSetValidation::destinationPSets(ParameterSet const& pset) { ParameterSet empty_PSet; - std::vector::const_iterator end = destinations.end(); - for (std::vector::const_iterator i = destinations.begin(); i != end; ++i) { + std::vector::const_iterator end = destinations_.end(); + for (std::vector::const_iterator i = destinations_.begin(); i != end; ++i) { ParameterSet const& d = pset.getUntrackedParameterSet(*i, empty_PSet); destinationPSet(d, *i); } @@ -460,19 +473,26 @@ namespace edm { // General parameters check(pset, psetName, "placeholder"); + { + std::string thresh = check(pset, "psetName", "statisticsThreshold"); + if (!thresh.empty()) + validateThreshold(thresh, psetName); + } std::string thresh = check(pset, "psetName", "threshold"); if (!thresh.empty()) validateThreshold(thresh, psetName); check(pset, psetName, "noLineBreaks"); check(pset, psetName, "lineLength"); check(pset, psetName, "noTimeStamps"); + check(pset, psetName, "enableStatistics"); + check(pset, psetName, "resetStatistics"); std::string s = check(pset, "psetName", "filename"); if ((s == "cerr") || (s == "cout")) { - flaws << psetName << " PSet: \n" << s << " is not allowed as a value of filename \n"; + flaws_ << psetName << " PSet: \n" << s << " is not allowed as a value of filename \n"; } s = check(pset, "psetName", "extension"); if ((s == "cerr") || (s == "cout")) { - flaws << psetName << " PSet: \n" << s << " is not allowed as a value of extension \n"; + flaws_ << psetName << " PSet: \n" << s << " is not allowed as a value of extension \n"; } s = check(pset, "psetName", "output"); @@ -485,8 +505,11 @@ namespace edm { okbool.push_back("optionalPSet"); okbool.push_back("noLineBreaks"); okbool.push_back("noTimeStamps"); + okbool.push_back("enableStatistics"); + okbool.push_back("resetStatistics"); noneExcept(pset, psetName, "bool", okbool); vString okstring; + okstring.push_back("statisticsThreshold"); okstring.push_back("threshold"); okstring.push_back("output"); okstring.push_back("filename"); @@ -546,9 +569,9 @@ namespace edm { void edm::service::MessageServicePSetValidation::statisticsPSets(ParameterSet const& pset) { ParameterSet empty_PSet; - std::vector::const_iterator end = statistics.end(); - for (std::vector::const_iterator i = statistics.begin(); i != end; ++i) { - if (lookForMatch(destinations, *i)) + std::vector::const_iterator end = statistics_.end(); + for (std::vector::const_iterator i = statistics_.begin(); i != end; ++i) { + if (lookForMatch(destinations_, *i)) continue; ParameterSet const& d = pset.getUntrackedParameterSet(*i, empty_PSet); statisticsPSet(d, *i); @@ -574,11 +597,11 @@ namespace edm { check(pset, psetName, "reset"); std::string s = check(pset, "psetName", "filename"); if ((s == "cerr") || (s == "cout")) { - flaws << psetName << " PSet: \n" << s << " is not allowed as a value of filename \n"; + flaws_ << psetName << " PSet: \n" << s << " is not allowed as a value of filename \n"; } s = check(pset, "psetName", "extension"); if ((s == "cerr") || (s == "cout")) { - flaws << psetName << " PSet: \n" << s << " is not allowed as a value of extension \n"; + flaws_ << psetName << " PSet: \n" << s << " is not allowed as a value of extension \n"; } s = check(pset, "psetName", "output"); @@ -606,7 +629,7 @@ namespace edm { pset.getParameterSetNames(psnames, false); vString::const_iterator end = psnames.end(); for (vString::const_iterator i = psnames.begin(); i != end; ++i) { - if (lookForMatch(categories, *i)) + if (lookForMatch(categories_, *i)) continue; if ((*i) == "default") continue; @@ -630,15 +653,15 @@ namespace edm { } if (ok_optionalPSet) continue; - flaws << psetName << " PSet: \n" << *i << " is an unrecognized name for a PSet in this context \n"; + flaws_ << psetName << " PSet: \n" << *i << " is an unrecognized name for a PSet in this context \n"; } psnames.clear(); unsigned int n = pset.getParameterSetNames(psnames, true); if (n > 0) { end = psnames.end(); for (vString::const_iterator i = psnames.begin(); i != end; ++i) { - flaws << psetName << " PSet: \n" - << "PSet " << *i << " is tracked - not allowed\n"; + flaws_ << psetName << " PSet: \n" + << "PSet " << *i << " is tracked - not allowed\n"; } } } // noNoncategoryPsets @@ -654,8 +677,8 @@ namespace edm { categoryPSet(pset, psetName, "default"); // The above conditional is because default in the main level is treated // as a set of defaults differnt from those of a simple category. - std::vector::const_iterator end = categories.end(); - for (std::vector::const_iterator i = categories.begin(); i != end; ++i) { + std::vector::const_iterator end = categories_.end(); + for (std::vector::const_iterator i = categories_.begin(); i != end; ++i) { categoryPSet(pset, psetName, *i); } } // categoryPSets @@ -664,8 +687,8 @@ namespace edm { std::string const& OuterPsetName, std::string const& categoryName) { if (pset.existsAs(categoryName, true)) { - flaws << OuterPsetName << " PSet: \n" - << "Category PSet " << categoryName << " is tracked - not allowed\n"; + flaws_ << OuterPsetName << " PSet: \n" + << "Category PSet " << categoryName << " is tracked - not allowed\n"; return; } ParameterSet empty_PSet; @@ -693,15 +716,15 @@ namespace edm { continue; if (*i == "timespan") continue; - flaws << categoryName << " category PSet nested in " << psetName << " PSet: \n" - << (*i) << " is not an allowed parameter within a category PSet \n"; + flaws_ << categoryName << " category PSet nested in " << psetName << " PSet: \n" + << (*i) << " is not an allowed parameter within a category PSet \n"; } x = pset.getParameterNamesForType(true); end = x.end(); for (vString::const_iterator i = x.begin(); i != end; ++i) { - flaws << categoryName << " category PSet nested in " << psetName << " PSet: \n" - << (*i) << " is used as a tracked int \n" - << "Tracked parameters not allowed here \n"; + flaws_ << categoryName << " category PSet nested in " << psetName << " PSet: \n" + << (*i) << " is used as a tracked int \n" + << "Tracked parameters not allowed here \n"; } } // catInts() @@ -712,19 +735,19 @@ namespace edm { pset.getParameterSetNames(psnames, false); vString::const_iterator end = psnames.end(); for (vString::const_iterator i = psnames.begin(); i != end; ++i) { - flaws << categoryName << " category PSet nested in " << psetName << " PSet: \n" - << *i << " is used as a PSet\n" - << "PSets not allowed within a category PSet\n"; + flaws_ << categoryName << " category PSet nested in " << psetName << " PSet: \n" + << *i << " is used as a PSet\n" + << "PSets not allowed within a category PSet\n"; } psnames.clear(); unsigned int n = pset.getParameterSetNames(psnames, true); if (n > 0) { end = psnames.end(); for (vString::const_iterator i = psnames.begin(); i != end; ++i) { - flaws << categoryName << " category PSet nested in " << psetName << " PSet: \n" - << *i << " is used as a tracked PSet\n" - << "tracked parameters not permitted, and " - << "PSets not allowed within a category PSet\n"; + flaws_ << categoryName << " category PSet nested in " << psetName << " PSet: \n" + << *i << " is used as a tracked PSet\n" + << "tracked parameters not permitted, and " + << "PSets not allowed within a category PSet\n"; } } } // catNoPSets @@ -738,17 +761,17 @@ namespace edm { for (vString::const_iterator i = x.begin(); i != end; ++i) { if (((*i) == "placeholder") || ((*i) == "optionalPSet")) continue; - flaws << categoryName << " category PSet nested in " << psetName << " PSet: \n" - << (*i) << " is used as a " << type << "\n" - << "Usage of " << type << " is not recognized here\n"; + flaws_ << categoryName << " category PSet nested in " << psetName << " PSet: \n" + << (*i) << " is used as a " << type << "\n" + << "Usage of " << type << " is not recognized here\n"; } x = pset.getParameterNamesForType(true); end = x.end(); for (vString::const_iterator i = x.begin(); i != end; ++i) { - flaws << categoryName << " category PSet nested in " << psetName << " PSet: \n" - << (*i) << " is used as a tracked " << type << "\n" - << "Tracked parameters not allowed here, " - << " and even untracked it would not be recognized\n"; + flaws_ << categoryName << " category PSet nested in " << psetName << " PSet: \n" + << (*i) << " is used as a tracked " << type << "\n" + << "Tracked parameters not allowed here, " + << " and even untracked it would not be recognized\n"; } } // catBoolRestriction() diff --git a/FWCore/MessageService/src/MessageServicePSetValidation.h b/FWCore/MessageService/src/MessageServicePSetValidation.h index b6038b5d6b09c..b3fb19794dcb4 100644 --- a/FWCore/MessageService/src/MessageServicePSetValidation.h +++ b/FWCore/MessageService/src/MessageServicePSetValidation.h @@ -101,16 +101,16 @@ namespace edm { return val; } if (pset.existsAs(parameterLabel, true)) { - flaws << psetName << " PSet: \n" << parameterLabel << " is declared as tracked - needs to be untracked \n"; + flaws_ << psetName << " PSet: \n" << parameterLabel << " is declared as tracked - needs to be untracked \n"; val = pset.getParameter(parameterLabel); } else { - flaws << psetName << " PSet: \n" << parameterLabel << " is declared with incorrect type \n"; + flaws_ << psetName << " PSet: \n" << parameterLabel << " is declared with incorrect type \n"; } return val; } catch (cms::Exception& e) { - flaws << psetName << " PSet: \n" - << parameterLabel << " is declared but causes an exception when processed: \n" - << e.what() << "\n"; + flaws_ << psetName << " PSet: \n" + << parameterLabel << " is declared but causes an exception when processed: \n" + << e.what() << "\n"; return val; } } // check() @@ -132,19 +132,19 @@ namespace edm { vString x = pset.template getParameterNamesForType(false); vString::const_iterator end = x.end(); for (vString::const_iterator i = x.begin(); i != end; ++i) { - flaws << psetName << " PSet: \n" - << (*i) << " is used as a " << type << "\n" - << "Usage of " << type << " is not recognized here\n"; + flaws_ << psetName << " PSet: \n" + << (*i) << " is used as a " << type << "\n" + << "Usage of " << type << " is not recognized here\n"; } x = pset.template getParameterNamesForType(true); end = x.end(); for (vString::const_iterator i = x.begin(); i != end; ++i) { if ((*i) == "@service_type") continue; - flaws << psetName << " PSet: \n" - << (*i) << " is used as a tracked " << type << "\n" - << "Tracked parameters not allowed here, " - << " and even untracked it would not be recognized\n"; + flaws_ << psetName << " PSet: \n" + << (*i) << " is used as a tracked " << type << "\n" + << "Tracked parameters not allowed here, " + << " and even untracked it would not be recognized\n"; } } // noneExcept() @@ -158,9 +158,9 @@ namespace edm { for (vString::const_iterator i = x.begin(); i != end; ++i) { std::string val = (*i); if (val != ok) { - flaws << psetName << " PSet: \n" - << val << " is used as a " << type << "\n" - << "This usage is not recognized in this type of PSet\n"; + flaws_ << psetName << " PSet: \n" + << val << " is used as a " << type << "\n" + << "This usage is not recognized in this type of PSet\n"; } } x = pset.template getParameterNamesForType(true); @@ -168,9 +168,9 @@ namespace edm { for (vString::const_iterator i = x.begin(); i != end; ++i) { if ((*i) == "@service_type") continue; - flaws << psetName << " PSet: \n" - << (*i) << " is used as a tracked " << type << "\n" - << "Tracked parameters not allowed here\n"; + flaws_ << psetName << " PSet: \n" + << (*i) << " is used as a tracked " << type << "\n" + << "Tracked parameters not allowed here\n"; } } // noneExcept(okValue) @@ -182,9 +182,9 @@ namespace edm { for (vString::const_iterator i = x.begin(); i != end; ++i) { std::string val = (*i); if ((val != ok1) && (val != ok2)) { - flaws << psetName << " PSet: \n" - << val << " is used as a " << type << "\n" - << "This usage is not recognized in this type of PSet\n"; + flaws_ << psetName << " PSet: \n" + << val << " is used as a " << type << "\n" + << "This usage is not recognized in this type of PSet\n"; } } x = pset.template getParameterNamesForType(true); @@ -192,9 +192,9 @@ namespace edm { for (vString::const_iterator i = x.begin(); i != end; ++i) { if ((*i) == "@service_type") continue; - flaws << psetName << " PSet: \n" - << (*i) << " is used as a tracked " << type << "\n" - << "Tracked parameters not allowed here\n"; + flaws_ << psetName << " PSet: \n" + << (*i) << " is used as a tracked " << type << "\n" + << "Tracked parameters not allowed here\n"; } } // noneExcept(okValue1, okValue2) @@ -213,9 +213,9 @@ namespace edm { found = true; } if (!found) { - flaws << psetName << " PSet: \n" - << *i << " is used as a " << type << "\n" - << "This usage is not recognized in this type of PSet\n"; + flaws_ << psetName << " PSet: \n" + << *i << " is used as a " << type << "\n" + << "This usage is not recognized in this type of PSet\n"; } } x = pset.template getParameterNamesForType(true); @@ -223,9 +223,9 @@ namespace edm { for (vString::const_iterator i = x.begin(); i != end; ++i) { if ((*i) == "@service_type") continue; - flaws << psetName << " PSet: \n" - << (*i) << " is used as a tracked " << type << "\n" - << "Tracked parameters not allowed here\n"; + flaws_ << psetName << " PSet: \n" + << (*i) << " is used as a tracked " << type << "\n" + << "Tracked parameters not allowed here\n"; } } // noneExcept(vok) @@ -237,31 +237,31 @@ namespace edm { vString x = pset.template getParameterNamesForType(false); vString::const_iterator end = x.end(); for (vString::const_iterator i = x.begin(); i != end; ++i) { - flaws << categoryName << " category PSet nested in " << psetName << " PSet: \n" - << (*i) << " is used as a " << type << "\n" - << "Usage of " << type << " is not recognized here\n"; + flaws_ << categoryName << " category PSet nested in " << psetName << " PSet: \n" + << (*i) << " is used as a " << type << "\n" + << "Usage of " << type << " is not recognized here\n"; } x = pset.template getParameterNamesForType(true); end = x.end(); for (vString::const_iterator i = x.begin(); i != end; ++i) { - flaws << categoryName << " category PSet nested in " << psetName << " PSet: \n" - << (*i) << " is used as a tracked " << type << "\n" - << "Tracked parameters not allowed here, " - << " and even untracked it would not be recognized\n"; + flaws_ << categoryName << " category PSet nested in " << psetName << " PSet: \n" + << (*i) << " is used as a tracked " << type << "\n" + << "Tracked parameters not allowed here, " + << " and even untracked it would not be recognized\n"; } } // catNone() // private data - std::ostringstream flaws; - std::vector destinations; - std::vector statistics; - std::vector categories; - std::vector debugModules; - std::vector suppressInfo; - std::vector suppressFwkInfo; - std::vector suppressDebug; - std::vector suppressWarning; - std::vector suppressError; + std::ostringstream flaws_; + std::vector destinations_; + std::vector statistics_; + std::vector categories_; + std::vector debugModules_; + std::vector suppressInfo_; + std::vector suppressFwkInfo_; + std::vector suppressDebug_; + std::vector suppressWarning_; + std::vector suppressError_; }; // MessageServicePSetValidation diff --git a/FWCore/MessageService/src/ThreadSafeLogMessageLoggerScribe.cc b/FWCore/MessageService/src/ThreadSafeLogMessageLoggerScribe.cc index b926325fba77d..712cd3404fe85 100644 --- a/FWCore/MessageService/src/ThreadSafeLogMessageLoggerScribe.cc +++ b/FWCore/MessageService/src/ThreadSafeLogMessageLoggerScribe.cc @@ -20,6 +20,9 @@ #include "FWCore/MessageLogger/interface/MessageDrop.h" // change log 37 #include "FWCore/MessageLogger/interface/ELseverityLevel.h" // change log 37 +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterWildcardWithSpecifics.h" + #include "FWCore/Utilities/interface/EDMException.h" #include "FWCore/Utilities/interface/Algorithms.h" @@ -35,16 +38,12 @@ namespace edm { namespace service { ThreadSafeLogMessageLoggerScribe::ThreadSafeLogMessageLoggerScribe() - : admin_p(new ELadministrator()), - early_dest(admin_p->attach(std::make_shared(std::cerr, false))), - file_ps(), - job_pset_p(), - clean_slate_configuration(true), - active(true), - purge_mode(false) // changeLog 32 - , - count(false) // changeLog 32 - , + : m_admin_p(std::make_shared()), + m_early_dest(m_admin_p->attach(std::make_shared(std::cerr, false))), + m_clean_slate_configuration(true), + m_active(true), + m_purge_mode(false), + m_count(0), m_messageBeingSent(false), m_waitingThreshold(100), m_tooManyWaitingMessagesCount(0) {} @@ -54,18 +53,18 @@ namespace edm { ErrorObj* errorobj_p = nullptr; std::vector categories; while (m_waitingMessages.try_pop(errorobj_p)) { - if (not purge_mode) { + if (not m_purge_mode) { categories.clear(); parseCategories(errorobj_p->xid().id, categories); for (unsigned int icat = 0; icat < categories.size(); ++icat) { errorobj_p->setID(categories[icat]); - admin_p->log(*errorobj_p); // route the message text + m_admin_p->log(*errorobj_p); // route the message text } } delete errorobj_p; } - admin_p->finish(); + m_admin_p->finish(); } void ThreadSafeLogMessageLoggerScribe::runCommand( // changeLog 32 @@ -82,31 +81,32 @@ namespace edm { case MessageLoggerQ::LOG_A_MESSAGE: { ErrorObj* errorobj_p = static_cast(operand); try { - if (active && !purge_mode) { + if (m_active && !m_purge_mode) { log(errorobj_p); } } catch (cms::Exception& e) { - ++count; - std::cerr << "ThreadSafeLogMessageLoggerScribe caught " << count << " cms::Exceptions, text = \n" + ++m_count; + std::cerr << "ThreadSafeLogMessageLoggerScribe caught " << m_count << " cms::Exceptions, text = \n" << e.what() << "\n"; - if (count > 25) { + if (m_count > 25) { cerr << "MessageLogger will no longer be processing " << "messages due to errors (entering purge mode).\n"; - purge_mode = true; + m_purge_mode = true; } } catch (...) { std::cerr << "ThreadSafeLogMessageLoggerScribe caught an unknown exception and " << "will no longer be processing " << "messages. (entering purge mode)\n"; - purge_mode = true; + m_purge_mode = true; } break; } case MessageLoggerQ::CONFIGURE: { // changelog 17 - job_pset_p = - std::shared_ptr(static_cast(operand)); // propagate_const has no reset() function - configure_errorlog(); + auto job_pset_p = std::unique_ptr( + static_cast(operand)); // propagate_const has no reset() function + validate(*job_pset_p); + configure_errorlog(*job_pset_p); break; } case MessageLoggerQ::SUMMARIZE: { @@ -126,8 +126,8 @@ namespace edm { case MessageLoggerQ::JOBMODE: { // change log 24 std::string* jobMode_p = static_cast(operand); JobMode jm = MessageLoggerDefaults::mode(*jobMode_p); - messageLoggerDefaults = value_ptr(new MessageLoggerDefaults(jm)); - // Note - since messageLoggerDefaults is a value_ptr, + m_messageLoggerDefaults = value_ptr(new MessageLoggerDefaults(jm)); + // Note - since m_messageLoggerDefaults is a value_ptr, // there is no concern about deleting here. delete jobMode_p; // dispose of the message text // which will have been new-ed @@ -136,7 +136,7 @@ namespace edm { } case MessageLoggerQ::SHUT_UP: { assert(operand == nullptr); - active = false; + m_active = false; break; } case MessageLoggerQ::FLUSH_LOG_Q: { // changelog 26 @@ -165,17 +165,17 @@ namespace edm { parseCategories(errorobj_p->xid().id, categories); for (unsigned int icat = 0; icat < categories.size(); ++icat) { errorobj_p->setID(categories[icat]); - admin_p->log(*errorobj_p); // route the message text + m_admin_p->log(*errorobj_p); // route the message text } //process any waiting messages errorobj_p = nullptr; - while (not purge_mode and m_waitingMessages.try_pop(errorobj_p)) { + while (not m_purge_mode and m_waitingMessages.try_pop(errorobj_p)) { obj.reset(errorobj_p); categories.clear(); parseCategories(errorobj_p->xid().id, categories); for (unsigned int icat = 0; icat < categories.size(); ++icat) { errorobj_p->setID(categories[icat]); - admin_p->log(*errorobj_p); // route the message text + m_admin_p->log(*errorobj_p); // route the message text } } m_messageBeingSent.store(false); @@ -189,76 +189,288 @@ namespace edm { } } - void ThreadSafeLogMessageLoggerScribe::configure_errorlog() { - vString empty_vString; - String empty_String; - PSet empty_PSet; + namespace { + bool usingOldConfig(edm::ParameterSet const& pset) { + if (not pset.exists("files") and + ((pset.exists("destinations") or pset.existsAs>("statistics", true) or + pset.existsAs>("statistics", false) or pset.exists("categories")))) { + return true; + } + return false; + } + + std::set findCategoriesInDestination(edm::ParameterSet const& pset) { + auto psets = pset.getParameterNamesForType(false); + auto itFound = std::find(psets.begin(), psets.end(), "default"); + if (itFound != psets.end()) { + psets.erase(itFound); + } + + return std::set(psets.begin(), psets.end()); + } + std::vector findAllCategories(edm::ParameterSet const& pset) { + std::set categories; + + auto psets = pset.getParameterNamesForType(false); + auto itFound = std::find(psets.begin(), psets.end(), "default"); + if (itFound != psets.end()) { + categories = findCategoriesInDestination(pset.getUntrackedParameter("default")); + psets.erase(itFound); + } + + itFound = std::find(psets.begin(), psets.end(), "cout"); + if (itFound != psets.end()) { + categories.merge(findCategoriesInDestination(pset.getUntrackedParameter("cout"))); + psets.erase(itFound); + } + + itFound = std::find(psets.begin(), psets.end(), "cerr"); + if (itFound != psets.end()) { + categories.merge(findCategoriesInDestination(pset.getUntrackedParameter("cerr"))); + psets.erase(itFound); + } + + auto const& files = pset.getUntrackedParameter("files"); + for (auto const& name : files.getParameterNamesForType(false)) { + categories.merge(findCategoriesInDestination(files.getUntrackedParameter(name))); + } + categories.insert(psets.begin(), psets.end()); + + return std::vector(categories.begin(), categories.end()); + } + + } // namespace + + std::string ThreadSafeLogMessageLoggerScribe::destinationFileName(edm::ParameterSet const& dest_pset, + std::string const& psetname) const { + // Determine the destination file name to use if no explicit filename is + // supplied in the cfg. + std::string const empty_String; + std::string filename = psetname; + std::string filename_default = getAparameter(dest_pset, "output", empty_String); + if (filename_default == empty_String) { + filename_default = m_messageLoggerDefaults->output(psetname); // change log 31 + if (filename_default == empty_String) { + filename_default = filename; + } + } + + std::string explicit_filename = getAparameter(dest_pset, "filename", filename_default); + if (explicit_filename != empty_String) + filename = explicit_filename; + std::string explicit_extension = getAparameter(dest_pset, "extension", empty_String); + if (explicit_extension != empty_String) { + if (explicit_extension[0] == '.') { + filename += explicit_extension; + } else { + filename = filename + "." + explicit_extension; + } + } + + // Attach a default extension of .log if there is no extension on a file + if ((filename != "cout") && (filename != "cerr")) { + if (filename.find('.') == std::string::npos) { + filename += ".log"; + } + } + return filename; + } + + void ThreadSafeLogMessageLoggerScribe::configure_errorlog_new(edm::ParameterSet& job_pset) { + { + auto preconfiguration_message = + job_pset.getUntrackedParameter("generate_preconfiguration_message"); + if (not preconfiguration_message.empty()) { + // To test a preconfiguration message without first going thru the + // configuration we are about to do, we issue the message (so it sits + // on the queue), then copy the processing that the LOG_A_MESSAGE case + // does. We suppress the timestamp to allow for automated unit testing. + m_early_dest->suppressTime(); + LogError("preconfiguration") << preconfiguration_message; + } + } + if (!m_stream_ps.empty()) { + LogWarning("multiLogConfig") << "The message logger has been configured multiple times"; + m_clean_slate_configuration = false; // Change Log 22 + } + m_waitingThreshold = job_pset.getUntrackedParameter("waiting_threshold"); + + auto defaults = parseDefaults(job_pset); + auto categories = findAllCategories(job_pset); + + // Initialize unversal suppression variables + MessageDrop::debugAlwaysSuppressed = true; + MessageDrop::infoAlwaysSuppressed = true; + MessageDrop::fwkInfoAlwaysSuppressed = true; + MessageDrop::warningAlwaysSuppressed = true; + + m_early_dest->setThreshold(ELhighestSeverity); + + auto cout_dest = job_pset.getUntrackedParameter("cout"); + if (cout_dest.getUntrackedParameter("enable")) { + auto dest_ctrl = makeDestinationCtrl("cout"); + configure_dest(job_pset, defaults, categories, dest_ctrl, cout_dest, "cout"); + } + + auto cerr_dest = job_pset.getUntrackedParameter("cerr"); + if (cerr_dest.getUntrackedParameter("enable")) { + auto dest_ctrl = makeDestinationCtrl("cerr"); + configure_dest(job_pset, defaults, categories, dest_ctrl, cerr_dest, "cerr"); + } + + auto const& files = job_pset.getUntrackedParameter("files"); + for (auto const& name : files.getParameterNamesForType(false)) { + auto const& dest_pset = files.getUntrackedParameter(name); + auto const actual_filename = destinationFileName(dest_pset, name); + + // Check that this is not a duplicate name + if (m_stream_ps.find(actual_filename) != m_stream_ps.end()) { + if (m_clean_slate_configuration) { + throw cms::Exception("DuplicateDestination") + << "Duplicate name for a MessageLogger Destination: " << actual_filename << "\n" + << "Please modify the configuration to use unique file names."; + } else { + LogWarning("duplicateDestination") + << "Duplicate name for a MessageLogger Destination: " << actual_filename << "\n" + << "Only original configuration instructions are used"; + continue; + } + } + + auto dest_ctrl = makeDestinationCtrl(actual_filename); + configure_dest(job_pset, defaults, categories, dest_ctrl, dest_pset, name); + } + //NOTE: statistics destinations MUST BE last in the list else they can be fooled into + // thinking a message has been ignored just because a later destination which uses it + // falls later in the list. + for (auto const& name : files.getParameterNamesForType(false)) { + auto const& dest_pset = files.getUntrackedParameter(name); + auto const actual_filename = destinationFileName(dest_pset, name); + if (getAparameter(dest_pset, "enableStatistics", false)) { + configure_statistics_dest(job_pset, defaults, categories, dest_pset, name, actual_filename); + } + } + } + + void ThreadSafeLogMessageLoggerScribe::configure_errorlog(edm::ParameterSet& job_pset) { + if (not usingOldConfig(job_pset)) { + configure_errorlog_new(job_pset); + return; + } + const vString empty_vString; + const std::string empty_String; + const edm::ParameterSet empty_PSet; // The following is present to test pre-configuration message handling: - String preconfiguration_message = - getAparameter(*job_pset_p, "generate_preconfiguration_message", empty_String); + std::string preconfiguration_message = + getAparameter(job_pset, "generate_preconfiguration_message", empty_String); if (preconfiguration_message != empty_String) { // To test a preconfiguration message without first going thru the // configuration we are about to do, we issue the message (so it sits // on the queue), then copy the processing that the LOG_A_MESSAGE case // does. We suppress the timestamp to allow for automated unit testing. - early_dest->suppressTime(); + m_early_dest->suppressTime(); LogError("preconfiguration") << preconfiguration_message; } - if (!stream_ps.empty()) { + if (!m_stream_ps.empty()) { LogWarning("multiLogConfig") << "The message logger has been configured multiple times"; - clean_slate_configuration = false; // Change Log 22 + m_clean_slate_configuration = false; // Change Log 22 } - m_waitingThreshold = getAparameter(*job_pset_p, "waiting_threshold", 100); - configure_ordinary_destinations(); // Change Log 16 - configure_statistics(); // Change Log 16 - } // ThreadSafeLogMessageLoggerScribe::configure_errorlog() - - void ThreadSafeLogMessageLoggerScribe::configure_dest(std::shared_ptr dest_ctrl, - String const& filename) { - static const int NO_VALUE_SET = -45654; // change log 2 - vString empty_vString; - PSet empty_PSet; - String empty_String; - - // Defaults: // change log 3a - const std::string COMMON_DEFAULT_THRESHOLD = "INFO"; - const int COMMON_DEFAULT_LIMIT = NO_VALUE_SET; - const int COMMON_DEFAULT_INTERVAL = NO_VALUE_SET; // change log 6 - const int COMMON_DEFAULT_TIMESPAN = NO_VALUE_SET; - - vString const severities = {{"WARNING", "INFO", "FWKINFO", "ERROR", "DEBUG"}}; - + m_waitingThreshold = getAparameter(job_pset, "waiting_threshold", 100); + auto defaults = parseDefaults(job_pset); // grab list of categories - vString categories = getAparameter(*job_pset_p, "categories", empty_vString); - + vString categories = getAparameter(job_pset, "categories", empty_vString); // grab list of hardwired categories (hardcats) -- these are to be added // to the list of categories -- change log 24 { - std::vector hardcats = messageLoggerDefaults->categories; + std::vector hardcats = m_messageLoggerDefaults->categories; // combine the lists, not caring about possible duplicates (for now) copy_all(hardcats, std::back_inserter(categories)); } // no longer need hardcats + auto destination_names = configure_ordinary_destinations(job_pset, defaults, categories); + configure_statistics(job_pset, defaults, categories, destination_names); + } // ThreadSafeLogMessageLoggerScribe::configure_errorlog() + + std::shared_ptr ThreadSafeLogMessageLoggerScribe::makeDestinationCtrl(std::string const& filename) { + std::shared_ptr dest_ctrl; + if (filename == "cout") { + dest_ctrl = m_admin_p->attach(std::make_shared(std::cout)); + m_stream_ps["cout"] = &std::cout; + } else if (filename == "cerr") { + m_early_dest->setThreshold(ELzeroSeverity); + dest_ctrl = m_early_dest; + m_stream_ps["cerr"] = &std::cerr; + } else { + auto os_sp = std::make_shared(filename.c_str()); + m_file_ps.push_back(os_sp); + dest_ctrl = m_admin_p->attach(std::make_shared(*os_sp)); + m_stream_ps[filename] = os_sp.get(); + } + return dest_ctrl; + } + + namespace { + void setGlobalThresholds(ELseverityLevel threshold_sev) { + if (threshold_sev <= ELseverityLevel::ELsev_success) { + edm::MessageDrop::debugAlwaysSuppressed = false; + } + if (threshold_sev <= ELseverityLevel::ELsev_info) { + edm::MessageDrop::infoAlwaysSuppressed = false; + } + if (threshold_sev <= ELseverityLevel::ELsev_fwkInfo) { + edm::MessageDrop::fwkInfoAlwaysSuppressed = false; + } + if (threshold_sev <= ELseverityLevel::ELsev_warning) { + edm::MessageDrop::warningAlwaysSuppressed = false; + } + } + } // namespace + + ThreadSafeLogMessageLoggerScribe::ConfigurableDefaults ThreadSafeLogMessageLoggerScribe::parseDefaults( + edm::ParameterSet const& job_pset) { + const edm::ParameterSet empty_PSet; + ThreadSafeLogMessageLoggerScribe::ConfigurableDefaults returnValue; + // grab default limit/interval/timespan common to all destinations/categories: + edm::ParameterSet default_pset = getAparameter(job_pset, "default", empty_PSet); + returnValue.limit_ = getAparameter( + default_pset, "limit", ThreadSafeLogMessageLoggerScribe::ConfigurableDefaults::COMMON_DEFAULT_LIMIT); + returnValue.reportEvery_ = getAparameter( + default_pset, "reportEvery", ThreadSafeLogMessageLoggerScribe::ConfigurableDefaults::COMMON_DEFAULT_INTERVAL); + returnValue.timespan_ = getAparameter( + default_pset, "timespan", ThreadSafeLogMessageLoggerScribe::ConfigurableDefaults::COMMON_DEFAULT_TIMESPAN); + std::string default_threshold = getAparameter(job_pset, "threshold", std::string()); + returnValue.threshold_ = getAparameter(default_pset, "threshold", default_threshold); + returnValue.noLineBreaks_ = getAparameter(default_pset, "noLineBreaks", false); + returnValue.lineLength_ = getAparameter(default_pset, "lineLength", 80); + returnValue.noTimeStamps_ = getAparameter(default_pset, "noTimeStamps", false); + + return returnValue; + } + + void ThreadSafeLogMessageLoggerScribe::configure_dest(edm::ParameterSet const& job_pset, + ConfigurableDefaults const& defaults, + vString const& categories, + std::shared_ptr dest_ctrl, + edm::ParameterSet const& dest_pset, + std::string const& filename) { + vString const empty_vString; + edm::ParameterSet const empty_PSet; + std::string const empty_String; + + // Defaults: // change log 3a + const std::string COMMON_DEFAULT_THRESHOLD = "INFO"; + + vString const severities = {{"WARNING", "INFO", "FWKINFO", "ERROR", "DEBUG"}}; + // grab default threshold common to all destinations - String default_threshold = getAparameter(*job_pset_p, "threshold", empty_String); + std::string const default_threshold = getAparameter(job_pset, "threshold", empty_String); // change log 3a // change log 24 // grab default limit/interval/timespan common to all destinations/categories: - PSet default_pset = getAparameter(*job_pset_p, "default", empty_PSet); - int default_limit = getAparameter(default_pset, "limit", COMMON_DEFAULT_LIMIT); - int default_interval = getAparameter(default_pset, "reportEvery", COMMON_DEFAULT_INTERVAL); - // change log 6, 10 - int default_timespan = getAparameter(default_pset, "timespan", COMMON_DEFAULT_TIMESPAN); - // change log 2a - // change log 3a - String default_pset_threshold = getAparameter(default_pset, "threshold", default_threshold); - // change log 34 - - // grab all of this destination's parameters: - PSet dest_pset = getAparameter(*job_pset_p, filename, empty_PSet); + edm::ParameterSet const default_pset = getAparameter(job_pset, "default", empty_PSet); // See if this is just a placeholder // change log 9 bool is_placeholder = getAparameter(dest_pset, "placeholder", false); @@ -266,97 +478,87 @@ namespace edm { return; // grab this destination's default limit/interval/timespan: - PSet dest_default_pset = getAparameter(dest_pset, "default", empty_PSet); - int dest_default_limit = getAparameter(dest_default_pset, "limit", default_limit); - int dest_default_interval = getAparameter(dest_default_pset, "reportEvery", default_interval); + edm::ParameterSet dest_default_pset = getAparameter(dest_pset, "default", empty_PSet); + int dest_default_limit = getAparameter(dest_default_pset, "limit", defaults.limit_); + int dest_default_interval = getAparameter(dest_default_pset, "reportEvery", defaults.reportEvery_); // change log 6 - int dest_default_timespan = getAparameter(dest_default_pset, "timespan", default_timespan); + int dest_default_timespan = getAparameter(dest_default_pset, "timespan", defaults.timespan_); // change log 1a - if (dest_default_limit != NO_VALUE_SET) { + if (dest_default_limit != defaults.NO_VALUE_SET) { if (dest_default_limit < 0) dest_default_limit = 2000000000; dest_ctrl->setLimit("*", dest_default_limit); - } // change log 1b, 2a, 2b - if (dest_default_interval != NO_VALUE_SET) { // change log 6 + } // change log 1b, 2a, 2b + if (dest_default_interval != defaults.NO_VALUE_SET) { // change log 6 dest_ctrl->setInterval("*", dest_default_interval); } - if (dest_default_timespan != NO_VALUE_SET) { + if (dest_default_timespan != defaults.NO_VALUE_SET) { if (dest_default_timespan < 0) dest_default_timespan = 2000000000; dest_ctrl->setTimespan("*", dest_default_timespan); } // change log 1b, 2a, 2b // establish this destination's threshold: - String dest_threshold = getAparameter(dest_pset, "threshold", default_threshold); + std::string dest_threshold = getAparameter(dest_pset, "threshold", default_threshold); if (dest_threshold == empty_String) { dest_threshold = default_threshold; } if (dest_threshold == empty_String) { // change log 34 - dest_threshold = default_pset_threshold; + dest_threshold = defaults.threshold_; } if (dest_threshold == empty_String) { - dest_threshold = messageLoggerDefaults->threshold(filename); + dest_threshold = m_messageLoggerDefaults->threshold(filename); } if (dest_threshold == empty_String) dest_threshold = COMMON_DEFAULT_THRESHOLD; ELseverityLevel threshold_sev(dest_threshold); dest_ctrl->setThreshold(threshold_sev); // change log 37 - if (threshold_sev <= ELseverityLevel::ELsev_success) { - edm::MessageDrop::debugAlwaysSuppressed = false; - } - if (threshold_sev <= ELseverityLevel::ELsev_info) { - edm::MessageDrop::infoAlwaysSuppressed = false; - } - if (threshold_sev <= ELseverityLevel::ELsev_fwkInfo) { - edm::MessageDrop::fwkInfoAlwaysSuppressed = false; - } - if (threshold_sev <= ELseverityLevel::ELsev_warning) { - edm::MessageDrop::warningAlwaysSuppressed = false; - } + setGlobalThresholds(threshold_sev); // establish this destination's limit/interval/timespan for each category: for (vString::const_iterator id_it = categories.begin(); id_it != categories.end(); ++id_it) { - String msgID = *id_it; - PSet default_category_pset = getAparameter(default_pset, msgID, empty_PSet); // change log 5 - PSet category_pset = getAparameter(dest_pset, msgID, default_category_pset); + std::string msgID = *id_it; + edm::ParameterSet default_category_pset = + getAparameter(default_pset, msgID, empty_PSet); // change log 5 + edm::ParameterSet category_pset = getAparameter(dest_pset, msgID, default_category_pset); - int category_default_limit = getAparameter(default_category_pset, "limit", NO_VALUE_SET); + int category_default_limit = getAparameter(default_category_pset, "limit", defaults.NO_VALUE_SET); int limit = getAparameter(category_pset, "limit", category_default_limit); - if (limit == NO_VALUE_SET) + if (limit == defaults.NO_VALUE_SET) limit = dest_default_limit; // change log 7 - int category_default_interval = getAparameter(default_category_pset, "reportEvery", NO_VALUE_SET); + int category_default_interval = getAparameter(default_category_pset, "reportEvery", defaults.NO_VALUE_SET); int interval = getAparameter(category_pset, "reportEvery", category_default_interval); - if (interval == NO_VALUE_SET) + if (interval == defaults.NO_VALUE_SET) interval = dest_default_interval; // change log 6 and then 7 - int category_default_timespan = getAparameter(default_category_pset, "timespan", NO_VALUE_SET); + int category_default_timespan = getAparameter(default_category_pset, "timespan", defaults.NO_VALUE_SET); int timespan = getAparameter(category_pset, "timespan", category_default_timespan); - if (timespan == NO_VALUE_SET) + if (timespan == defaults.NO_VALUE_SET) timespan = dest_default_timespan; // change log 7 const std::string& category = msgID; - if (limit == NO_VALUE_SET) { // change log 24 - limit = messageLoggerDefaults->limit(filename, category); + if (limit == defaults.NO_VALUE_SET) { // change log 24 + limit = m_messageLoggerDefaults->limit(filename, category); } - if (interval == NO_VALUE_SET) { // change log 24 - interval = messageLoggerDefaults->reportEvery(filename, category); + if (interval == defaults.NO_VALUE_SET) { // change log 24 + interval = m_messageLoggerDefaults->reportEvery(filename, category); } - if (timespan == NO_VALUE_SET) { // change log 24 - timespan = messageLoggerDefaults->timespan(filename, category); + if (timespan == defaults.NO_VALUE_SET) { // change log 24 + timespan = m_messageLoggerDefaults->timespan(filename, category); } - if (limit != NO_VALUE_SET) { + if (limit != defaults.NO_VALUE_SET) { if (limit < 0) limit = 2000000000; dest_ctrl->setLimit(msgID, limit); } // change log 2a, 2b - if (interval != NO_VALUE_SET) { + if (interval != defaults.NO_VALUE_SET) { dest_ctrl->setInterval(msgID, interval); } // change log 6 - if (timespan != NO_VALUE_SET) { + if (timespan != defaults.NO_VALUE_SET) { if (timespan < 0) timespan = 2000000000; dest_ctrl->setTimespan(msgID, timespan); @@ -366,32 +568,32 @@ namespace edm { // establish this destination's limit for each severity: for (vString::const_iterator sev_it = severities.begin(); sev_it != severities.end(); ++sev_it) { - String sevID = *sev_it; + std::string sevID = *sev_it; ELseverityLevel severity(sevID); - PSet default_sev_pset = getAparameter(default_pset, sevID, empty_PSet); - PSet sev_pset = getAparameter(dest_pset, sevID, default_sev_pset); + edm::ParameterSet default_sev_pset = getAparameter(default_pset, sevID, empty_PSet); + edm::ParameterSet sev_pset = getAparameter(dest_pset, sevID, default_sev_pset); // change log 5 - int limit = getAparameter(sev_pset, "limit", NO_VALUE_SET); - if (limit == NO_VALUE_SET) { // change log 24 - limit = messageLoggerDefaults->sev_limit(filename, sevID); + int limit = getAparameter(sev_pset, "limit", defaults.NO_VALUE_SET); + if (limit == defaults.NO_VALUE_SET) { // change log 24 + limit = m_messageLoggerDefaults->sev_limit(filename, sevID); } - if (limit != NO_VALUE_SET) { + if (limit != defaults.NO_VALUE_SET) { if (limit < 0) limit = 2000000000; // change log 38 dest_ctrl->setLimit(severity, limit); } - int interval = getAparameter(sev_pset, "reportEvery", NO_VALUE_SET); - if (interval == NO_VALUE_SET) { // change log 24 - interval = messageLoggerDefaults->sev_reportEvery(filename, sevID); + int interval = getAparameter(sev_pset, "reportEvery", defaults.NO_VALUE_SET); + if (interval == defaults.NO_VALUE_SET) { // change log 24 + interval = m_messageLoggerDefaults->sev_reportEvery(filename, sevID); } - if (interval != NO_VALUE_SET) + if (interval != defaults.NO_VALUE_SET) dest_ctrl->setInterval(severity, interval); // change log 2 - int timespan = getAparameter(sev_pset, "timespan", NO_VALUE_SET); - if (timespan == NO_VALUE_SET) { // change log 24 - timespan = messageLoggerDefaults->sev_timespan(filename, sevID); + int timespan = getAparameter(sev_pset, "timespan", defaults.NO_VALUE_SET); + if (timespan == defaults.NO_VALUE_SET) { // change log 24 + timespan = m_messageLoggerDefaults->sev_timespan(filename, sevID); } - if (timespan != NO_VALUE_SET) { + if (timespan != defaults.NO_VALUE_SET) { if (timespan < 0) timespan = 2000000000; // change log 38 dest_ctrl->setTimespan(severity, timespan); @@ -399,35 +601,29 @@ namespace edm { } // for // establish this destination's linebreak policy: - bool noLineBreaks_default = getAparameter(default_pset, "noLineBreaks", false); // change log 5 - bool noLineBreaks = getAparameter(dest_pset, "noLineBreaks", noLineBreaks_default); + bool noLineBreaks = getAparameter(dest_pset, "noLineBreaks", defaults.noLineBreaks_); if (noLineBreaks) { dest_ctrl->setLineLength(32000); } else { - int lenDef = 80; - int lineLen_default = getAparameter(default_pset, "lineLength", lenDef); // change log 5 - int lineLen = getAparameter(dest_pset, "lineLength", lineLen_default); - if (lineLen != lenDef) { - dest_ctrl->setLineLength(lineLen); - } + int lineLen = getAparameter(dest_pset, "lineLength", defaults.lineLength_); + dest_ctrl->setLineLength(lineLen); } // if indicated, suppress time stamps in this destination's output - bool suppressTime_default = getAparameter(default_pset, "noTimeStamps", false); - bool suppressTime = getAparameter(dest_pset, "noTimeStamps", suppressTime_default); + bool suppressTime = getAparameter(dest_pset, "noTimeStamps", defaults.noTimeStamps_); if (suppressTime) { dest_ctrl->suppressTime(); } } // ThreadSafeLogMessageLoggerScribe::configure_dest() - void ThreadSafeLogMessageLoggerScribe::configure_ordinary_destinations() // Changelog 16 - { - vString empty_vString; - String empty_String; - PSet empty_PSet; + std::vector ThreadSafeLogMessageLoggerScribe::configure_ordinary_destinations( + edm::ParameterSet const& job_pset, ConfigurableDefaults const& defaults, vString const& categories) { + vString const empty_vString; + std::string const empty_String; + edm::ParameterSet const empty_PSet; // Initialize unversal suppression variables MessageDrop::debugAlwaysSuppressed = true; @@ -436,25 +632,26 @@ namespace edm { MessageDrop::warningAlwaysSuppressed = true; // grab list of destinations: - vString destinations = getAparameter(*job_pset_p, "destinations", empty_vString); + vString destinations = getAparameter(job_pset, "destinations", empty_vString); // Use the default list of destinations if and only if the grabbed list is // empty // change log 24 if (destinations.empty()) { - destinations = messageLoggerDefaults->destinations; + destinations = m_messageLoggerDefaults->destinations; } // dial down the early destination if other dest's are supplied: if (!destinations.empty()) - early_dest->setThreshold(ELhighestSeverity); + m_early_dest->setThreshold(ELhighestSeverity); // establish each destination: + std::vector ordinary_destination_filenames; for (vString::const_iterator it = destinations.begin(); it != destinations.end(); ++it) { - String filename = *it; - String psetname = filename; + std::string filename = *it; + const std::string& psetname = filename; // check that this destination is not just a placeholder // change log 11 - PSet dest_pset = getAparameter(*job_pset_p, psetname, empty_PSet); + edm::ParameterSet dest_pset = getAparameter(job_pset, psetname, empty_PSet); bool is_placeholder = getAparameter(dest_pset, "placeholder", false); if (is_placeholder) continue; @@ -469,42 +666,11 @@ namespace edm { // an extension() method. We recognize the potential name confusion here // (filename(filename))! - // Determine the destination file name to use if no explicit filename is - // supplied in the cfg. - String filename_default = getAparameter(dest_pset, "output", empty_String); - if (filename_default == empty_String) { - filename_default = messageLoggerDefaults->output(psetname); // change log 31 - if (filename_default == empty_String) { - filename_default = filename; - } - } - - String explicit_filename = getAparameter(dest_pset, "filename", filename_default); - if (explicit_filename != empty_String) - filename = explicit_filename; - String explicit_extension = getAparameter(dest_pset, "extension", empty_String); - if (explicit_extension != empty_String) { - if (explicit_extension[0] == '.') { - filename += explicit_extension; - } else { - filename = filename + "." + explicit_extension; - } - } - - // Attach a default extension of .log if there is no extension on a file - // change log 18 - this had been done in concert with attaching destination - - std::string actual_filename = filename; // change log 4 - if ((filename != "cout") && (filename != "cerr")) { - const std::string::size_type npos = std::string::npos; - if (filename.find('.') == npos) { - actual_filename += ".log"; - } - } + auto const actual_filename = destinationFileName(dest_pset, psetname); // Check that this is not a duplicate name // change log 18 - if (stream_ps.find(actual_filename) != stream_ps.end()) { - if (clean_slate_configuration) { // change log 22 + if (m_stream_ps.find(actual_filename) != m_stream_ps.end()) { + if (m_clean_slate_configuration) { // change log 22 // throw edm::Exception ( edm::errors::Configuration ) LogError("duplicateDestination") // change log 35 << "Duplicate name for a MessageLogger Destination: " << actual_filename << "\n" @@ -521,35 +687,59 @@ namespace edm { ordinary_destination_filenames.push_back(actual_filename); // attach the current destination, keeping a control handle to it: - std::shared_ptr dest_ctrl; - if (actual_filename == "cout") { - dest_ctrl = admin_p->attach(std::make_shared(std::cout)); - stream_ps["cout"] = &std::cout; - } else if (actual_filename == "cerr") { - early_dest->setThreshold(ELzeroSeverity); - dest_ctrl = early_dest; - stream_ps["cerr"] = &std::cerr; - } else { - auto os_sp = std::make_shared(actual_filename.c_str()); - file_ps.push_back(os_sp); - dest_ctrl = admin_p->attach(std::make_shared(*os_sp)); - stream_ps[actual_filename] = os_sp.get(); - } - + std::shared_ptr dest_ctrl = makeDestinationCtrl(actual_filename); // now configure this destination: - configure_dest(dest_ctrl, psetname); + configure_dest(job_pset, defaults, categories, dest_ctrl, dest_pset, psetname); } // for [it = destinations.begin() to end()] + return ordinary_destination_filenames; } // configure_ordinary_destinations - void ThreadSafeLogMessageLoggerScribe::configure_statistics() { - vString empty_vString; - String empty_String; - PSet empty_PSet; + void ThreadSafeLogMessageLoggerScribe::configure_statistics_dest(edm::ParameterSet const& job_pset, + ConfigurableDefaults const& defaults, + vString const& categories, + edm::ParameterSet const& stat_pset, + std::string const& psetname, + std::string const& filename) { + auto os_p = m_stream_ps[filename]; + + auto stat = std::make_shared(*os_p); + m_admin_p->attach(stat); + m_statisticsDestControls.push_back(stat); + bool reset = getAparameter(stat_pset, "resetStatistics", false); + if (not reset) { + //check for old syntax + reset = getAparameter(stat_pset, "reset", false); + } + m_statisticsResets.push_back(reset); + + // now configure this destination: + configure_dest(job_pset, defaults, categories, stat, stat_pset, psetname); + + std::string dest_threshold = getAparameter(stat_pset, "statisticsThreshold", std::string()); + if (not dest_threshold.empty()) { + ELseverityLevel threshold_sev(dest_threshold); + stat->setThreshold(threshold_sev); + + setGlobalThresholds(threshold_sev); + } + + // and suppress the desire to do an extra termination summary just because + // of end-of-job info messages + stat->noTerminationSummary(); + } + + void ThreadSafeLogMessageLoggerScribe::configure_statistics(edm::ParameterSet const& job_pset, + ConfigurableDefaults const& defaults, + vString const& categories, + vString const& ordinary_destination_filenames) { + vString const empty_vString; + std::string const empty_String; + edm::ParameterSet const empty_PSet; // grab list of statistics destinations: - vString statistics = getAparameter(*job_pset_p, "statistics", empty_vString); + vString statistics = getAparameter(job_pset, "statistics", empty_vString); bool no_statistics_configured = statistics.empty(); // change log 24 @@ -558,30 +748,34 @@ namespace edm { // but only if there is also no list of ordinary destinations. // (If a cfg specifies destinations, and no statistics, assume that // is what the user wants.) - vString destinations = getAparameter(*job_pset_p, "destinations", empty_vString); + vString destinations = getAparameter(job_pset, "destinations", empty_vString); if (destinations.empty()) { - statistics = messageLoggerDefaults->statistics; + statistics = m_messageLoggerDefaults->statistics; no_statistics_configured = statistics.empty(); + } else { + for (auto const& dest : destinations) { + edm::ParameterSet stat_pset = getAparameter(job_pset, dest, empty_PSet); + if (getAparameter(stat_pset, "enableStatistics", false)) { + statistics.push_back(dest); + } + } } } // establish each statistics destination: - for (vString::const_iterator it = statistics.begin(); it != statistics.end(); ++it) { - String statname = *it; - const String& psetname = statname; - + for (auto const& psetname : statistics) { // check that this destination is not just a placeholder // change log 20 - PSet stat_pset = getAparameter(*job_pset_p, psetname, empty_PSet); + edm::ParameterSet stat_pset = getAparameter(job_pset, psetname, empty_PSet); bool is_placeholder = getAparameter(stat_pset, "placeholder", false); if (is_placeholder) continue; // Determine the destination file name - String filename = getAparameter(stat_pset, "output", empty_String); + std::string filename = getAparameter(stat_pset, "output", empty_String); if (filename == empty_String) { - filename = messageLoggerDefaults->output(psetname); // change log 31 + filename = m_messageLoggerDefaults->output(psetname); // change log 31 if (filename == empty_String) { - filename = statname; + filename = psetname; } } @@ -589,10 +783,10 @@ namespace edm { // change log 14 -- probably suspenders and a belt, because ouput option // is present, but uniformity is nice. - String explicit_filename = getAparameter(stat_pset, "filename", filename); + std::string explicit_filename = getAparameter(stat_pset, "filename", filename); if (explicit_filename != empty_String) filename = explicit_filename; - String explicit_extension = getAparameter(stat_pset, "extension", empty_String); + std::string explicit_extension = getAparameter(stat_pset, "extension", empty_String); if (explicit_extension != empty_String) { if (explicit_extension[0] == '.') { filename += explicit_extension; @@ -615,8 +809,8 @@ namespace edm { // Check that this is not a duplicate name - // unless it is an ordinary destination (which stats can share) if (!search_all(ordinary_destination_filenames, actual_filename)) { - if (stream_ps.find(actual_filename) != stream_ps.end()) { - if (clean_slate_configuration) { // change log 22 + if (m_stream_ps.find(actual_filename) != m_stream_ps.end()) { + if (m_clean_slate_configuration) { // change log 22 throw edm::Exception(edm::errors::Configuration) << "Duplicate name for a MessageLogger Statistics Destination: " << actual_filename << "\n"; } else { @@ -635,36 +829,25 @@ namespace edm { // it is matches a destination. (shange log 24) bool statistics_destination_is_real = !no_statistics_configured; std::ostream* os_p; - if (stream_ps.find(actual_filename) == stream_ps.end()) { + if (m_stream_ps.find(actual_filename) == m_stream_ps.end()) { if (actual_filename == "cout") { os_p = &std::cout; } else if (actual_filename == "cerr") { os_p = &std::cerr; } else { auto os_sp = std::make_shared(actual_filename.c_str()); - file_ps.push_back(os_sp); + m_file_ps.push_back(os_sp); os_p = os_sp.get(); } - stream_ps[actual_filename] = os_p; + m_stream_ps[actual_filename] = os_p; } else { statistics_destination_is_real = true; // change log 24 - os_p = stream_ps[actual_filename]; } if (statistics_destination_is_real) { // change log 24 // attach the statistics destination, keeping a control handle to it: - auto stat = std::make_shared(*os_p); - admin_p->attach(stat); - statisticsDestControls.push_back(stat); - bool reset = getAparameter(stat_pset, "reset", false); - statisticsResets.push_back(reset); - - // now configure this destination: - configure_dest(stat, psetname); - // and suppress the desire to do an extra termination summary just because - // of end-of-job info messages - stat->noTerminationSummary(); + configure_statistics_dest(job_pset, defaults, categories, stat_pset, psetname, actual_filename); } } // for [it = statistics.begin() to end()] @@ -687,22 +870,119 @@ namespace edm { } void ThreadSafeLogMessageLoggerScribe::triggerStatisticsSummaries() { - assert(statisticsDestControls.size() == statisticsResets.size()); - for (unsigned int i = 0; i != statisticsDestControls.size(); ++i) { - statisticsDestControls[i]->summary(m_tooManyWaitingMessagesCount.load()); - if (statisticsResets[i]) - statisticsDestControls[i]->wipe(); + assert(m_statisticsDestControls.size() == m_statisticsResets.size()); + for (unsigned int i = 0; i != m_statisticsDestControls.size(); ++i) { + m_statisticsDestControls[i]->summary(m_tooManyWaitingMessagesCount.load()); + if (m_statisticsResets[i]) + m_statisticsDestControls[i]->wipe(); } } void ThreadSafeLogMessageLoggerScribe::triggerFJRmessageSummary(std::map& sm) // ChangeLog 29 { - if (statisticsDestControls.empty()) { + if (m_statisticsDestControls.empty()) { sm["NoStatisticsDestinationsConfigured"] = 0.0; } else { - statisticsDestControls[0]->summaryForJobReport(sm); + m_statisticsDestControls[0]->summaryForJobReport(sm); } } + namespace { + void fillDescriptions(edm::ConfigurationDescriptions& config) { + edm::ParameterSetDescription topDesc; + + topDesc.addUntracked("messageSummaryToJobReport", false); + topDesc.addUntracked("generate_preconfiguration_message", ""); + topDesc.addUntracked("waiting_threshold", 100); + topDesc.addUntracked>("suppressDebug", {}); + topDesc.addUntracked>("suppressInfo", {}); + topDesc.addUntracked>("suppressFwkInfo", {}); + topDesc.addUntracked>("suppressWarning", {}); + topDesc.addUntracked>("suppressError", {}); + topDesc.addUntracked>("debugModules", {}); + + edm::ParameterSetDescription category; + category.addUntracked("reportEvery", 1); + category.addUntracked("limit", ThreadSafeLogMessageLoggerScribe::ConfigurableDefaults::NO_VALUE_SET) + ->setComment( + "Set a limit on the number of messages of this category. The default value is used to denote no " + "limit."); + category.addOptionalUntracked("timespan"); + + edm::ParameterSetDescription destination_base; + destination_base.addOptionalUntracked("noLineBreaks"); + destination_base.addOptionalUntracked("noTimeStamps"); + destination_base.addOptionalUntracked("lineLength"); + destination_base.addOptionalUntracked("threshold"); + destination_base.addOptionalUntracked("statisticsThreshold"); + + edm::ParameterWildcard catnode("*", edm::RequireZeroOrMore, false, category); + catnode.setComment("Specialize either a category or any of 'DEBUG', 'INFO', 'FWKINFO', 'WARNING' or 'ERROR'"); + destination_base.addNode(catnode); + + edm::ParameterSetDescription destination_noStats(destination_base); + destination_noStats.addUntracked("enableStatistics", false); + destination_noStats.addUntracked("resetStatistics", false); + + { + edm::ParameterSetDescription default_pset; + default_pset.addUntracked("reportEvery", 1); + default_pset.addUntracked("limit", ThreadSafeLogMessageLoggerScribe::ConfigurableDefaults::NO_VALUE_SET) + ->setComment( + "Set a limit on the number of messages of this category. The default value is used to denote no " + "limit."); + default_pset.addOptionalUntracked("timespan"); + default_pset.addUntracked("noLineBreaks", false); + default_pset.addUntracked("noTimeStamps", false); + default_pset.addUntracked("lineLength", 80); + default_pset.addUntracked("threshold", "INFO"); + default_pset.addUntracked("statisticsThreshold", "INFO"); + default_pset.addNode(catnode); + + edm::ParameterSetDescription cerr_destination(destination_base); + cerr_destination.addUntracked("enableStatistics", true); + cerr_destination.addUntracked("resetStatistics", false); + cerr_destination.addUntracked("enable", true); + + edm::ParameterSetDescription cout_destination(destination_noStats); + cout_destination.addUntracked("enable", false); + + edm::ParameterSetDescription fileDestination(destination_noStats); + + fileDestination.addOptionalUntracked("output"); + fileDestination.addOptionalUntracked("filename"); + fileDestination.addOptionalUntracked("extension"); + edm::ParameterSetDescription files; + edm::ParameterWildcard fileWildcard( + "*", edm::RequireZeroOrMore, false, fileDestination); + files.addNode(fileWildcard); + + std::map standards = { + {"cerr", cerr_destination}, {"cout", cout_destination}, {"default", default_pset}, {"files", files}}; + + edm::ParameterWildcardWithSpecifics psets("*", edm::RequireZeroOrMore, false, category, std::move(standards)); + topDesc.addNode(psets); + } + + config.addDefault(topDesc); + } + } // namespace + + void ThreadSafeLogMessageLoggerScribe::validate(edm::ParameterSet& pset) const { + // See if old config API is being used + if (usingOldConfig(pset)) + return; + if (not pset.exists("files") and + ((pset.exists("destinations") or pset.existsAs>("statistics", true) or + pset.existsAs>("statistics", false) or pset.exists("categories")))) { + return; + } + + ConfigurationDescriptions config{"MessageLogger", "MessageLogger"}; + fillDescriptions(config); + + config.validate(pset, "MessageLogger"); + } + } // end of namespace service } // end of namespace edm diff --git a/FWCore/MessageService/src/ThreadSafeLogMessageLoggerScribe.h b/FWCore/MessageService/src/ThreadSafeLogMessageLoggerScribe.h index 824d9895e335b..ffc562c687c58 100644 --- a/FWCore/MessageService/src/ThreadSafeLogMessageLoggerScribe.h +++ b/FWCore/MessageService/src/ThreadSafeLogMessageLoggerScribe.h @@ -50,11 +50,26 @@ namespace edm { void runCommand(MessageLoggerQ::OpCode opcode, void* operand) override; // changeLog 9 + struct ConfigurableDefaults { + static constexpr int NO_VALUE_SET = -45654; + static constexpr int COMMON_DEFAULT_LIMIT = NO_VALUE_SET; + static constexpr int COMMON_DEFAULT_INTERVAL = NO_VALUE_SET; + static constexpr int COMMON_DEFAULT_TIMESPAN = NO_VALUE_SET; + + std::string threshold_; + int limit_; + int reportEvery_; + int timespan_; + int lineLength_; + bool noLineBreaks_; + bool noTimeStamps_; + }; + private: + static ConfigurableDefaults parseDefaults(edm::ParameterSet const& job_pset); + // --- convenience typedefs - typedef std::string String; - typedef std::vector vString; - typedef ParameterSet PSet; + using vString = std::vector; // --- log one consumed message void log(ErrorObj* errorobj_p); @@ -64,13 +79,30 @@ namespace edm { void triggerFJRmessageSummary(std::map& sm); // --- handle details of configuring via a ParameterSet: - void configure_errorlog(); - void configure_ordinary_destinations(); // Change Log 3 - void configure_statistics(); // Change Log 3 - void configure_dest(std::shared_ptr dest_ctrl, String const& filename); - - template // ChangeLog 11 - T getAparameter(PSet const& p, std::string const& id, T const& def) { + void configure_errorlog(edm::ParameterSet&); + void configure_errorlog_new(edm::ParameterSet&); + std::vector configure_ordinary_destinations(edm::ParameterSet const&, + ConfigurableDefaults const& defaults, + vString const& categories); + void configure_statistics(edm::ParameterSet const&, + ConfigurableDefaults const& defaults, + vString const& categories, + std::vector const& destination_names); + void configure_statistics_dest(edm::ParameterSet const& job_pset, + ConfigurableDefaults const& defaults, + vString const& categories, + edm::ParameterSet const& stat_pset, + std::string const& psetname, + std::string const& filename); + void configure_dest(edm::ParameterSet const& job_pset, + ConfigurableDefaults const&, + vString const& categories, + std::shared_ptr dest_ctrl, + edm::ParameterSet const& dest_pset, + std::string const& filename); + + template + static T getAparameter(edm::ParameterSet const& p, std::string const& id, T const& def) { T t = def; try { t = p.template getUntrackedParameter(id, def); @@ -88,21 +120,22 @@ namespace edm { // --- other helpers void parseCategories(std::string const& s, std::vector& cats); + std::string destinationFileName(edm::ParameterSet const&, std::string const&) const; + std::shared_ptr makeDestinationCtrl(std::string const& filename); + void validate(edm::ParameterSet&) const; // --- data: - edm::propagate_const> admin_p; - std::shared_ptr early_dest; - std::vector>> file_ps; - edm::propagate_const> job_pset_p; - std::map> stream_ps; - std::vector ordinary_destination_filenames; - std::vector> statisticsDestControls; - std::vector statisticsResets; - bool clean_slate_configuration; - value_ptr messageLoggerDefaults; - bool active; - std::atomic purge_mode; // changeLog 9 - std::atomic count; // changeLog 9 + edm::propagate_const> m_admin_p; + std::shared_ptr m_early_dest; + std::vector>> m_file_ps; + std::map> m_stream_ps; + std::vector> m_statisticsDestControls; + std::vector m_statisticsResets; + bool m_clean_slate_configuration; + value_ptr m_messageLoggerDefaults; + bool m_active; + std::atomic m_purge_mode; + std::atomic m_count; std::atomic m_messageBeingSent; tbb::concurrent_queue m_waitingMessages; size_t m_waitingThreshold; diff --git a/FWCore/MessageService/test/PsetValidationSamples/cat_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/cat_cfg.py index 3030698b22ec3..f99f9081d73b2 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/cat_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/cat_cfg.py @@ -13,8 +13,7 @@ process.MessageLogger = cms.Service("MessageLogger", destinations = cms.untracked.vstring( 'u1_warnings', 'u1_errors', - 'u1_infos', 'u1_debugs', 'u1_default', 'u1_x'), - statistics = cms.untracked.vstring( 'u1_warnings', 'u1_default', 'u1_y' ), + 'u1_infos', 'u1_debugs', 'u1_default', 'u1_x'), categories = cms.untracked.vstring('preEventProcessing','FwkTest', 'cat_A','cat_B', 'cat_J', 'cat_K'), @@ -75,7 +74,8 @@ ), u1_warnings = cms.untracked.PSet( threshold = cms.untracked.string('WARNING'), - noTimeStamps = cms.untracked.bool(True) + noTimeStamps = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True) ), u1_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), @@ -89,6 +89,7 @@ ), u1_default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True), FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), diff --git a/FWCore/MessageService/test/PsetValidationSamples/categories_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/categories_cfg.py index 71a1abf68859e..b10981345cfcd 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/categories_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/categories_cfg.py @@ -14,7 +14,6 @@ destinations = cms.untracked.vstring( 'u1_warnings', 'u1_errors', 'u1_infos', 'u1_debugs', 'u1_default', 'u1_x'), - statistics = cms.untracked.vstring( 'u1_warnings', 'u1_default', 'u1_y'), #enable one of the following -- the first should pass, the rest fail categories = cms.untracked.vstring('preEventProcessing','FwkTest', @@ -43,7 +42,8 @@ ), u1_warnings = cms.untracked.PSet( threshold = cms.untracked.string('WARNING'), - noTimeStamps = cms.untracked.bool(True) + noTimeStamps = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True) ), u1_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), @@ -57,6 +57,7 @@ ), u1_default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True), FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), diff --git a/FWCore/MessageService/test/PsetValidationSamples/debugModules_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/debugModules_cfg.py index e19d403f7e0d7..d523f9bf35820 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/debugModules_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/debugModules_cfg.py @@ -14,7 +14,6 @@ destinations = cms.untracked.vstring( 'u1_warnings', 'u1_errors', 'u1_infos', 'u1_debugs', 'u1_default', 'u1_x'), - statistics = cms.untracked.vstring( 'u1_warnings', 'u1_default', 'u1_y'), categories = cms.untracked.vstring('preEventProcessing','FwkTest', 'cat_A','cat_B'), @@ -42,7 +41,8 @@ ), u1_warnings = cms.untracked.PSet( threshold = cms.untracked.string('WARNING'), - noTimeStamps = cms.untracked.bool(True) + noTimeStamps = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True) ), u1_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), @@ -56,6 +56,7 @@ ), u1_default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True) FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), diff --git a/FWCore/MessageService/test/PsetValidationSamples/dest_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/dest_cfg.py index b5e3c7d304363..55196d2840167 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/dest_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/dest_cfg.py @@ -14,7 +14,6 @@ destinations = cms.untracked.vstring( 'u1_warnings', 'u1_errors', 'u1_infos', 'u1_debugs', 'u1_default', 'u1_x'), - statistics = cms.untracked.vstring( 'u1_warnings', 'u1_default', 'u1_y' ), categories = cms.untracked.vstring('preEventProcessing','FwkTest', 'cat_A','cat_B'), @@ -61,7 +60,8 @@ ), u1_warnings = cms.untracked.PSet( threshold = cms.untracked.string('WARNING'), - noTimeStamps = cms.untracked.bool(True) + noTimeStamps = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True) ), u1_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), @@ -75,6 +75,7 @@ ), u1_default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True), FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), diff --git a/FWCore/MessageService/test/PsetValidationSamples/fwkJRlist_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/fwkJRlist_cfg.py index 9fdd1b6f25d1f..c779553089fcc 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/fwkJRlist_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/fwkJRlist_cfg.py @@ -14,7 +14,6 @@ destinations = cms.untracked.vstring( 'u1_warnings', 'u1_errors', 'u1_infos', 'u1_debugs', 'u1_default', 'u1_x'), - statistics = cms.untracked.vstring( 'u1_warnings', 'u1_default', 'u1_y'), u1_infos = cms.untracked.PSet( @@ -29,7 +28,8 @@ ), u1_warnings = cms.untracked.PSet( threshold = cms.untracked.string('WARNING'), - noTimeStamps = cms.untracked.bool(True) + noTimeStamps = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True) ), u1_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), @@ -43,6 +43,7 @@ ), u1_default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True), FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), diff --git a/FWCore/MessageService/test/PsetValidationSamples/statlist_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/statlist_cfg.py index 80b79f23fd5ce..ea292fc1170c5 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/statlist_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/statlist_cfg.py @@ -1,5 +1,5 @@ # Test of a feature of PSet validation: -# The vstring statistics list +# The statistics import FWCore.ParameterSet.Config as cms @@ -15,13 +15,6 @@ destinations = cms.untracked.vstring( 'u1_warnings', 'u1_errors', 'u1_infos', 'u1_debugs', 'u1_default', 'u1_x'), -#enable one of the following -- the first should pass, the rest fail - statistics = cms.untracked.vstring( 'u1_warnings', 'u1_default', 'u1_y'), -# statistics = cms.vstring('cout'), -# statistics = cms.untracked.int32(2), -# statistics = cms.untracked.vstring('u1_warnings', 'u1_errors', 'u1_warnings'), -# statistics = cms.untracked.vstring('cout','limit'), - u1_infos = cms.untracked.PSet( threshold = cms.untracked.string('INFO'), @@ -35,7 +28,8 @@ ), u1_warnings = cms.untracked.PSet( threshold = cms.untracked.string('WARNING'), - noTimeStamps = cms.untracked.bool(True) + noTimeStamps = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True) ), u1_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), @@ -49,6 +43,7 @@ ), u1_default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True), FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), diff --git a/FWCore/MessageService/test/PsetValidationSamples/suppress_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/suppress_cfg.py index e83009fbd1eb1..e5944d30a573d 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/suppress_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/suppress_cfg.py @@ -14,7 +14,6 @@ destinations = cms.untracked.vstring( 'u1_warnings', 'u1_errors', 'u1_infos', 'u1_debugs', 'u1_default', 'u1_x'), - statistics = cms.untracked.vstring( 'u1_warnings', 'u1_default', 'u1_y'), categories = cms.untracked.vstring('preEventProcessing','FwkTest', 'cat_A','cat_B'), debugModules = cms.untracked.vstring('*'), @@ -44,7 +43,8 @@ ), u1_warnings = cms.untracked.PSet( threshold = cms.untracked.string('WARNING'), - noTimeStamps = cms.untracked.bool(True) + noTimeStamps = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True) ), u1_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), @@ -58,6 +58,7 @@ ), u1_default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True), FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), diff --git a/FWCore/MessageService/test/PsetValidationSamples/vstring_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/vstring_cfg.py index 7f5f76073a2e6..2b1bcce93ff7d 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/vstring_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/vstring_cfg.py @@ -14,7 +14,6 @@ destinations = cms.untracked.vstring( 'u1_warnings', 'u1_errors', 'u1_infos', 'u1_debugs', 'u1_default', 'u1_x'), - statistics = cms.untracked.vstring( 'u1_warnings', 'u1_default', 'u1_y'), categories = cms.untracked.vstring('preEventProcessing','FwkTest', 'cat_A','cat_B'), debugModules = cms.untracked.vstring('*'), @@ -36,7 +35,8 @@ ), u1_warnings = cms.untracked.PSet( threshold = cms.untracked.string('WARNING'), - noTimeStamps = cms.untracked.bool(True) + noTimeStamps = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True) ), u1_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), @@ -50,6 +50,7 @@ ), u1_default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True), FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), diff --git a/FWCore/MessageService/test/PsetValidationSamples/xPSet_cfg.py b/FWCore/MessageService/test/PsetValidationSamples/xPSet_cfg.py index bd42db21dc0c1..778c3bc392f02 100644 --- a/FWCore/MessageService/test/PsetValidationSamples/xPSet_cfg.py +++ b/FWCore/MessageService/test/PsetValidationSamples/xPSet_cfg.py @@ -14,7 +14,6 @@ destinations = cms.untracked.vstring( 'u1_warnings', 'u1_errors', 'u1_infos', 'u1_debugs', 'u1_default', 'u1_x'), - statistics = cms.untracked.vstring( 'u1_warnings', 'u1_default', 'u1_y'), categories = cms.untracked.vstring('preEventProcessing','FwkTest', 'cat_A','cat_B'), debugModules = cms.untracked.vstring('*'), @@ -36,7 +35,8 @@ ), u1_warnings = cms.untracked.PSet( threshold = cms.untracked.string('WARNING'), - noTimeStamps = cms.untracked.bool(True) + noTimeStamps = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True) ), u1_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), @@ -50,6 +50,8 @@ ), u1_default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True), + FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ), diff --git a/FWCore/MessageService/test/filter-timestamps.sed b/FWCore/MessageService/test/filter-timestamps.sed index f749dfeafbb54..212111cef3d18 100644 --- a/FWCore/MessageService/test/filter-timestamps.sed +++ b/FWCore/MessageService/test/filter-timestamps.sed @@ -1 +1 @@ -s/ [0-9]?[0-9]-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-2[0-9][0-9][0-9] [0-9]?[0-9]:[0-9][0-9]:[0-9][0-9](\.[0-9][0-9][0-9])? [A-Z]?[A-Z][A-Z][A-Z]( |\t|$)/ {Timestamp} / +s/ [0-9]?[0-9]-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-2[0-9][0-9][0-9] [0-9]?[0-9]:[0-9][0-9]:[0-9][0-9](\.[0-9][0-9][0-9])? [A-Z]?[A-Z][A-Z][A-Z]( |\t|-|$)/ {Timestamp} / diff --git a/FWCore/MessageService/test/u10_cfg.py b/FWCore/MessageService/test/u10_cfg.py index 6d67597f08d31..7b2e36677afce 100644 --- a/FWCore/MessageService/test/u10_cfg.py +++ b/FWCore/MessageService/test/u10_cfg.py @@ -11,11 +11,15 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - u10_warnings = cms.untracked.PSet( - threshold = cms.untracked.string('WARNING'), - noTimeStamps = cms.untracked.bool(True) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), - destinations = cms.untracked.vstring('u10_warnings'), + files = cms.untracked.PSet( + u10_warnings = cms.untracked.PSet( + threshold = cms.untracked.string('WARNING'), + noTimeStamps = cms.untracked.bool(True) + ) + ) ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u11_cfg.py b/FWCore/MessageService/test/u11_cfg.py index a9ad919612cbc..06282c8e3efc5 100644 --- a/FWCore/MessageService/test/u11_cfg.py +++ b/FWCore/MessageService/test/u11_cfg.py @@ -18,24 +18,8 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - u11_supercede_specific = cms.untracked.PSet( - default = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - int4bydefault = cms.untracked.PSet( - reportEvery = cms.untracked.int32(10), - limit = cms.untracked.int32(-1) - ), - expect_supercede_specific = cms.untracked.PSet( - reportEvery = cms.untracked.int32(1), - limit = cms.untracked.int32(-1) - ), - int25bydefaults = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - int7bycommondefault = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), default = cms.untracked.PSet( expect_specific = cms.untracked.PSet( @@ -70,87 +54,92 @@ limit = cms.untracked.int32(0) ) ), - u11_overall_specific = cms.untracked.PSet( - default = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - int4bydefault = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - expect_overall_specific = cms.untracked.PSet( - reportEvery = cms.untracked.int32(1), - limit = cms.untracked.int32(-1) - ), - int25bydefaults = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) - ), - u11_non_supercede_common = cms.untracked.PSet( - int4bydefault = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - expect_non_supercede_common_specific = cms.untracked.PSet( - reportEvery = cms.untracked.int32(1), - limit = cms.untracked.int32(-1) - ), - default = cms.untracked.PSet( - reportEvery = cms.untracked.int32(18), - limit = cms.untracked.int32(3) - ), - int25bydefaults = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) - ), - u11_specific = cms.untracked.PSet( - int4bydefault = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - expect_specific = cms.untracked.PSet( - reportEvery = cms.untracked.int32(1), - limit = cms.untracked.int32(-1) - ), - noTimeStamps = cms.untracked.bool(True), - default = cms.untracked.PSet( - reportEvery = cms.untracked.int32(30) - ), - int25bydefaults = cms.untracked.PSet( - reportEvery = cms.untracked.int32(12) - ), - int7bycommondefault = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) - ), - u11_overall_unnamed = cms.untracked.PSet( - int4bydefault = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - int25bydefaults = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - int7bycommondefault = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - expect_overall_unnamed = cms.untracked.PSet( - reportEvery = cms.untracked.int32(1), - limit = cms.untracked.int32(-1) + files = cms.untracked.PSet( + u11_supercede_specific = cms.untracked.PSet( + default = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + int4bydefault = cms.untracked.PSet( + reportEvery = cms.untracked.int32(10), + limit = cms.untracked.int32(-1) + ), + expect_supercede_specific = cms.untracked.PSet( + reportEvery = cms.untracked.int32(1), + limit = cms.untracked.int32(-1) + ), + int25bydefaults = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + int7bycommondefault = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) + ), + u11_overall_specific = cms.untracked.PSet( + default = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + int4bydefault = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + expect_overall_specific = cms.untracked.PSet( + reportEvery = cms.untracked.int32(1), + limit = cms.untracked.int32(-1) + ), + int25bydefaults = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) + ), + u11_non_supercede_common = cms.untracked.PSet( + int4bydefault = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + expect_non_supercede_common_specific = cms.untracked.PSet( + reportEvery = cms.untracked.int32(1), + limit = cms.untracked.int32(-1) + ), + default = cms.untracked.PSet( + reportEvery = cms.untracked.int32(18), + limit = cms.untracked.int32(3) + ), + int25bydefaults = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) + ), + u11_specific = cms.untracked.PSet( + int4bydefault = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + expect_specific = cms.untracked.PSet( + reportEvery = cms.untracked.int32(1), + limit = cms.untracked.int32(-1) + ), + noTimeStamps = cms.untracked.bool(True), + default = cms.untracked.PSet( + reportEvery = cms.untracked.int32(30) + ), + int25bydefaults = cms.untracked.PSet( + reportEvery = cms.untracked.int32(12) + ), + int7bycommondefault = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) + ), + u11_overall_unnamed = cms.untracked.PSet( + int4bydefault = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + int25bydefaults = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + int7bycommondefault = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + expect_overall_unnamed = cms.untracked.PSet( + reportEvery = cms.untracked.int32(1), + limit = cms.untracked.int32(-1) + ) ) - ), - categories = cms.untracked.vstring('preEventProcessing', - 'int4bydefault', - 'int7bycommondefault', - 'int25bydefaults', - 'expect_overall_unnamed', - 'expect_overall_specific', - 'expect_supercede_specific', - 'expect_non_supercede_common_specific', - 'expect_specific', - 'FwkReport', - 'FwkTest'), - destinations = cms.untracked.vstring('u11_overall_unnamed', - 'u11_overall_specific', - 'u11_supercede_specific', - 'u11_non_supercede_common', - 'u11_specific') + ) ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u12_cfg.py b/FWCore/MessageService/test/u12_cfg.py index 4a828517e443f..10b52b96e2468 100644 --- a/FWCore/MessageService/test/u12_cfg.py +++ b/FWCore/MessageService/test/u12_cfg.py @@ -11,16 +11,15 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - u12_warnings = cms.untracked.PSet( - threshold = cms.untracked.string('WARNING'), - noTimeStamps = cms.untracked.bool(True) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), - u12_placeholder = cms.untracked.PSet( - placeholder = cms.untracked.bool(True) - ), - categories = cms.untracked.vstring('preEventProcessing'), - destinations = cms.untracked.vstring('u12_warnings', - 'u12_placeholder') + files = cms.untracked.PSet( + u12_warnings = cms.untracked.PSet( + threshold = cms.untracked.string('WARNING'), + noTimeStamps = cms.untracked.bool(True) + ) + ) ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u13_cfg.py b/FWCore/MessageService/test/u13_cfg.py index d9a3e49fa741f..e80a0680ebdc1 100644 --- a/FWCore/MessageService/test/u13_cfg.py +++ b/FWCore/MessageService/test/u13_cfg.py @@ -11,38 +11,32 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - u13_infos = cms.untracked.PSet( - threshold = cms.untracked.string('INFO'), - noTimeStamps = cms.untracked.bool(True), - FwkReport = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) - ), debugModules = cms.untracked.vstring('*'), - u13_debugs = cms.untracked.PSet( - threshold = cms.untracked.string('DEBUG'), - noTimeStamps = cms.untracked.bool(True), - FwkReport = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) + ), + files = cms.untracked.PSet( + u13_infos = cms.untracked.PSet( + threshold = cms.untracked.string('INFO'), + noTimeStamps = cms.untracked.bool(True), + FwkReport = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) ), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(0) + u13_debugs = cms.untracked.PSet( + threshold = cms.untracked.string('DEBUG'), + noTimeStamps = cms.untracked.bool(True), + FwkReport = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) ) - ), - categories = cms.untracked.vstring('preEventProcessing', - 'FwkReport', - 'FwkTest'), - destinations = cms.untracked.vstring('u13_infos', - 'u13_debugs') + ) ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u13d_cfg.py b/FWCore/MessageService/test/u13d_cfg.py index f915865a60e30..9820dfa7a6e01 100644 --- a/FWCore/MessageService/test/u13d_cfg.py +++ b/FWCore/MessageService/test/u13d_cfg.py @@ -12,21 +12,24 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - u13d_infos = cms.untracked.PSet( - threshold = cms.untracked.string('INFO'), - noTimeStamps = cms.untracked.bool(True), - FwkReport = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), - debugModules = cms.untracked.vstring('*'), - u13d_debugs = cms.untracked.PSet( + files = cms.untracked.PSet( + u13d_infos = cms.untracked.PSet( + threshold = cms.untracked.string('INFO'), + noTimeStamps = cms.untracked.bool(True), + FwkReport = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + preEventProcessing = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) + ), + u13d_debugs = cms.untracked.PSet( threshold = cms.untracked.string('DEBUG'), noTimeStamps = cms.untracked.bool(True), FwkReport = cms.untracked.PSet( @@ -38,12 +41,9 @@ FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ) + ) ), - categories = cms.untracked.vstring('preEventProcessing', - 'FwkReport', - 'FwkTest'), - destinations = cms.untracked.vstring('u13d_infos', - 'u13d_debugs') + debugModules = cms.untracked.vstring('*'), ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u14_cfg.py b/FWCore/MessageService/test/u14_cfg.py index 97857579954cc..c1a9729dddd12 100644 --- a/FWCore/MessageService/test/u14_cfg.py +++ b/FWCore/MessageService/test/u14_cfg.py @@ -13,41 +13,31 @@ process.MessageLogger = cms.Service("MessageLogger", suppressInfo = cms.untracked.vstring('sendSomeMessages'), suppressFwkInfo = cms.untracked.vstring('source'), - u14_default = cms.untracked.PSet( - noTimeStamps = cms.untracked.bool(True), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) - ), - u14_errors = cms.untracked.PSet( - threshold = cms.untracked.string('ERROR'), - noTimeStamps = cms.untracked.bool(True) - ), - u14_infos = cms.untracked.PSet( - threshold = cms.untracked.string('INFO'), - noTimeStamps = cms.untracked.bool(True), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) - ), - u14_warnings = cms.untracked.PSet( - threshold = cms.untracked.string('WARNING'), - noTimeStamps = cms.untracked.bool(True) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), - u14_debugs = cms.untracked.PSet( - threshold = cms.untracked.string('DEBUG'), - noTimeStamps = cms.untracked.bool(True), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) + files = cms.untracked.PSet( + u14_default = cms.untracked.PSet( + noTimeStamps = cms.untracked.bool(True) + ), + u14_errors = cms.untracked.PSet( + threshold = cms.untracked.string('ERROR'), + noTimeStamps = cms.untracked.bool(True) + ), + u14_infos = cms.untracked.PSet( + threshold = cms.untracked.string('INFO'), + noTimeStamps = cms.untracked.bool(True) + ), + u14_warnings = cms.untracked.PSet( + threshold = cms.untracked.string('WARNING'), + noTimeStamps = cms.untracked.bool(True) + ), + u14_debugs = cms.untracked.PSet( + threshold = cms.untracked.string('DEBUG'), + noTimeStamps = cms.untracked.bool(True) ) ), - debugModules = cms.untracked.vstring('*'), - categories = cms.untracked.vstring('preEventProcessing'), - destinations = cms.untracked.vstring('u14_warnings', - 'u14_errors', - 'u14_infos', - 'u14_debugs', - 'u14_default') + debugModules = cms.untracked.vstring('*') ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u15_cfg.py b/FWCore/MessageService/test/u15_cfg.py index 540a6a836564e..facc084f178db 100644 --- a/FWCore/MessageService/test/u15_cfg.py +++ b/FWCore/MessageService/test/u15_cfg.py @@ -12,38 +12,32 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - u15_debugs = cms.untracked.PSet( - threshold = cms.untracked.string('DEBUG'), - noTimeStamps = cms.untracked.bool(True), - FwkReport = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) - ), debugModules = cms.untracked.vstring('*'), - u15_infos = cms.untracked.PSet( - threshold = cms.untracked.string('INFO'), - noTimeStamps = cms.untracked.bool(True), - FwkReport = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) + ), + files = cms.untracked.PSet( + u15_debugs = cms.untracked.PSet( + threshold = cms.untracked.string('DEBUG'), + noTimeStamps = cms.untracked.bool(True), + FwkReport = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) ), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(0) + u15_infos = cms.untracked.PSet( + threshold = cms.untracked.string('INFO'), + noTimeStamps = cms.untracked.bool(True), + FwkReport = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) ) - ), - categories = cms.untracked.vstring('preEventProcessing', - 'FwkReport', - 'FwkTest'), - destinations = cms.untracked.vstring('u15_infos', - 'u15_debugs') + ) ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u16-2warnings_cfg.py b/FWCore/MessageService/test/u16-2warnings_cfg.py index ee294b861288b..c4cf8879d12c8 100644 --- a/FWCore/MessageService/test/u16-2warnings_cfg.py +++ b/FWCore/MessageService/test/u16-2warnings_cfg.py @@ -12,76 +12,69 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - # put stats into u16_errors.mmlog and another file - statistics = cms.untracked.vstring('u16_statistics', - 'u16_errors'), - # produce file u16_statistics.mslog - u16_statistics = cms.untracked.PSet( - threshold = cms.untracked.string('WARNING'), - noTimeStamps = cms.untracked.bool(True), - extension = cms.untracked.string('mslog') - ), - # produce file u16_job_report.mmxml - u16_job_report = cms.untracked.PSet( - extension = cms.untracked.string('mmxml') + debugModules = cms.untracked.vstring('*'), + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), default = cms.untracked.PSet( FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ) ), - # produce file u16_errors.mmlog - u16_errors = cms.untracked.PSet( - threshold = cms.untracked.string('ERROR'), - noTimeStamps = cms.untracked.bool(True), - extension = cms.untracked.string('mmlog') - ), - # produce file u16_altWarnings.log - u16_warnings = cms.untracked.PSet( - threshold = cms.untracked.string('WARNING'), - noTimeStamps = cms.untracked.bool(True), - filename = cms.untracked.string('u16_altWarnings') - ), - # produce file u16_default.log - u16_default = cms.untracked.PSet( - noTimeStamps = cms.untracked.bool(True), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) - ), - # produce file u16_infos.mmlog - u16_infos = cms.untracked.PSet( - threshold = cms.untracked.string('INFO'), - noTimeStamps = cms.untracked.bool(True), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) + files = cms.untracked.PSet( + # produce file u16_statistics.mslog + u16_statistics = cms.untracked.PSet( + threshold = cms.untracked.string('WARNING'), + noTimeStamps = cms.untracked.bool(True), + extension = cms.untracked.string('mslog'), + enableStatistics = cms.untracked.bool(True), + default = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) ), - extension = cms.untracked.string('.mmlog') - ), - # produce file u16_altDebugs.mmlog - u16_debugs = cms.untracked.PSet( - threshold = cms.untracked.string('DEBUG'), - noTimeStamps = cms.untracked.bool(True), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) + # produce file u16_job_report.mmxml + u16_job_report = cms.untracked.PSet( + extension = cms.untracked.string('mmxml') ), - extension = cms.untracked.string('mmlog'), - filename = cms.untracked.string('u16_altDebugs') - ), - destinations = cms.untracked.vstring('u16_warnings', - 'u16_warnings2', - 'u16_errors', - 'u16_infos', - 'u16_debugs', - 'u16_default'), - debugModules = cms.untracked.vstring('*'), - categories = cms.untracked.vstring('preEventProcessing', - 'FwkTest'), - # produce another file u16_altWarnings.log - temporary test - u16_warnings2 = cms.untracked.PSet( - threshold = cms.untracked.string('WARNING'), - noTimeStamps = cms.untracked.bool(True), - filename = cms.untracked.string('u16_altWarnings') + # produce file u16_errors.mmlog + u16_errors = cms.untracked.PSet( + threshold = cms.untracked.string('ERROR'), + noTimeStamps = cms.untracked.bool(True), + extension = cms.untracked.string('mmlog'), + enableStatistics = cms.untracked.bool(True) + ), + # produce file u16_altWarnings.log + u16_warnings = cms.untracked.PSet( + threshold = cms.untracked.string('WARNING'), + noTimeStamps = cms.untracked.bool(True), + filename = cms.untracked.string('u16_altWarnings') + ), + # produce file u16_default.log + u16_default = cms.untracked.PSet( + noTimeStamps = cms.untracked.bool(True) + ), + # produce file u16_infos.mmlog + u16_infos = cms.untracked.PSet( + threshold = cms.untracked.string('INFO'), + noTimeStamps = cms.untracked.bool(True), + extension = cms.untracked.string('.mmlog') + ), + # produce file u16_altDebugs.mmlog + u16_debugs = cms.untracked.PSet( + threshold = cms.untracked.string('DEBUG'), + noTimeStamps = cms.untracked.bool(True), + preEventProcessing = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + extension = cms.untracked.string('mmlog'), + filename = cms.untracked.string('u16_altDebugs') + ), + # produce another file u16_altWarnings.log - temporary test + u16_warnings2 = cms.untracked.PSet( + threshold = cms.untracked.string('WARNING'), + noTimeStamps = cms.untracked.bool(True), + filename = cms.untracked.string('u16_altWarnings') + ) ) ) diff --git a/FWCore/MessageService/test/u16_cfg.py b/FWCore/MessageService/test/u16_cfg.py index 337ca767745b7..920e75ac5ba08 100644 --- a/FWCore/MessageService/test/u16_cfg.py +++ b/FWCore/MessageService/test/u16_cfg.py @@ -12,65 +12,56 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - # put stats into u16_errors.mmlog and another file - statistics = cms.untracked.vstring('u16_statistics', - 'u16_errors'), - # produce file u16_statistics.mslog - u16_statistics = cms.untracked.PSet( - threshold = cms.untracked.string('WARNING'), - extension = cms.untracked.string('mslog') - ), default = cms.untracked.PSet( FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ) ), - # produce file u16_errors.mmlog - u16_errors = cms.untracked.PSet( - threshold = cms.untracked.string('ERROR'), - noTimeStamps = cms.untracked.bool(True), - extension = cms.untracked.string('mmlog') - ), - # produce file u16_altWarnings.log - u16_warnings = cms.untracked.PSet( - threshold = cms.untracked.string('WARNING'), - noTimeStamps = cms.untracked.bool(True), - filename = cms.untracked.string('u16_altWarnings') - ), - # produce file u16_default.log - u16_default = cms.untracked.PSet( - noTimeStamps = cms.untracked.bool(True), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), - # produce file u16_infos.mmlog - u16_infos = cms.untracked.PSet( - threshold = cms.untracked.string('INFO'), - noTimeStamps = cms.untracked.bool(True), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) + files = cms.untracked.PSet( + # produce file u16_statistics.mslog + u16_statistics = cms.untracked.PSet( + threshold = cms.untracked.string('WARNING'), + extension = cms.untracked.string('mslog'), + enableStatistics = cms.untracked.bool(True), + default = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) ), - extension = cms.untracked.string('.mmlog') - ), - # produce file u16_altDebugs.mmlog - u16_debugs = cms.untracked.PSet( - threshold = cms.untracked.string('DEBUG'), - noTimeStamps = cms.untracked.bool(True), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) + # produce file u16_errors.mmlog + u16_errors = cms.untracked.PSet( + threshold = cms.untracked.string('ERROR'), + noTimeStamps = cms.untracked.bool(True), + extension = cms.untracked.string('mmlog'), + enableStatistics = cms.untracked.bool(True) + ), + # produce file u16_altWarnings.log + u16_warnings = cms.untracked.PSet( + threshold = cms.untracked.string('WARNING'), + noTimeStamps = cms.untracked.bool(True), + filename = cms.untracked.string('u16_altWarnings') ), - extension = cms.untracked.string('mmlog'), - filename = cms.untracked.string('u16_altDebugs') + # produce file u16_default.log + u16_default = cms.untracked.PSet( + noTimeStamps = cms.untracked.bool(True) + ), + # produce file u16_infos.mmlog + u16_infos = cms.untracked.PSet( + threshold = cms.untracked.string('INFO'), + noTimeStamps = cms.untracked.bool(True), + extension = cms.untracked.string('.mmlog') + ), + # produce file u16_altDebugs.mmlog + u16_debugs = cms.untracked.PSet( + threshold = cms.untracked.string('DEBUG'), + noTimeStamps = cms.untracked.bool(True), + extension = cms.untracked.string('mmlog'), + filename = cms.untracked.string('u16_altDebugs') + ) ), - debugModules = cms.untracked.vstring('*'), - categories = cms.untracked.vstring('preEventProcessing', - 'FwkTest'), - destinations = cms.untracked.vstring('u16_warnings', - 'u16_errors', - 'u16_infos', - 'u16_debugs', - 'u16_default') + debugModules = cms.untracked.vstring('*') ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u17_cfg.py b/FWCore/MessageService/test/u17_cfg.py index 11c13ef6e92ff..8bcf621ad7a07 100644 --- a/FWCore/MessageService/test/u17_cfg.py +++ b/FWCore/MessageService/test/u17_cfg.py @@ -15,28 +15,28 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - statistics = cms.untracked.vstring('u17_all'), - categories = cms.untracked.vstring('cat_P', - 'cat_S', - 'FwkTest', - 'FwkReport'), - u17_all = cms.untracked.PSet( - threshold = cms.untracked.string('INFO'), - noTimeStamps = cms.untracked.bool(True), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - FwkReport = cms.untracked.PSet( - limit = cms.untracked.int32(110) - ), - cat_P = cms.untracked.PSet( - limit = cms.untracked.int32(2) - ), - cat_S = cms.untracked.PSet( - limit = cms.untracked.int32(2) - ) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), - destinations = cms.untracked.vstring('u17_all') + files = cms.untracked.PSet( + u17_all = cms.untracked.PSet( + threshold = cms.untracked.string('INFO'), + noTimeStamps = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + FwkReport = cms.untracked.PSet( + limit = cms.untracked.int32(110) + ), + cat_P = cms.untracked.PSet( + limit = cms.untracked.int32(2) + ), + cat_S = cms.untracked.PSet( + limit = cms.untracked.int32(2) + ) + ) + ) ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u18_cfg.py b/FWCore/MessageService/test/u18_cfg.py index ab9743539c5dc..e86639f7650b4 100644 --- a/FWCore/MessageService/test/u18_cfg.py +++ b/FWCore/MessageService/test/u18_cfg.py @@ -11,23 +11,22 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - u18_system = cms.untracked.PSet( - threshold = cms.untracked.string('ERROR'), - default = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - noTimeStamps = cms.untracked.bool(True) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), - u18_everything = cms.untracked.PSet( - threshold = cms.untracked.string('INFO'), - noTimeStamps = cms.untracked.bool(True), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) + files = cms.untracked.PSet( + u18_system = cms.untracked.PSet( + threshold = cms.untracked.string('ERROR'), + default = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + noTimeStamps = cms.untracked.bool(True) + ), + u18_everything = cms.untracked.PSet( + threshold = cms.untracked.string('INFO'), + noTimeStamps = cms.untracked.bool(True), ) - ), - categories = cms.untracked.vstring('preEventProcessing'), - destinations = cms.untracked.vstring('u18_system', - 'u18_everything') + ) ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u19_cfg.py b/FWCore/MessageService/test/u19_cfg.py index df36eb38b4fea..60b58de2ea582 100644 --- a/FWCore/MessageService/test/u19_cfg.py +++ b/FWCore/MessageService/test/u19_cfg.py @@ -11,32 +11,26 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - u19_infos = cms.untracked.PSet( - threshold = cms.untracked.string('INFO'), - noTimeStamps = cms.untracked.bool(True), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) - ), debugModules = cms.untracked.vstring('*'), - destinations = cms.untracked.vstring('u19_infos', - 'u19_debugs'), - u19_debugs = cms.untracked.PSet( - threshold = cms.untracked.string('DEBUG'), - noTimeStamps = cms.untracked.bool(True), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(0) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) + ), + files = cms.untracked.PSet( + u19_infos = cms.untracked.PSet( + threshold = cms.untracked.string('INFO'), + noTimeStamps = cms.untracked.bool(True), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) ), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) + u19_debugs = cms.untracked.PSet( + threshold = cms.untracked.string('DEBUG'), + noTimeStamps = cms.untracked.bool(True), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) ) - ), - categories = cms.untracked.vstring('preEventProcessing', - 'FwkTest', - 'ridiculously_long_category_name') + ) ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u19d_cfg.py b/FWCore/MessageService/test/u19d_cfg.py index ae74c31adf0ad..53a869e01e3bb 100644 --- a/FWCore/MessageService/test/u19d_cfg.py +++ b/FWCore/MessageService/test/u19d_cfg.py @@ -12,32 +12,30 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - u19d_infos = cms.untracked.PSet( - threshold = cms.untracked.string('INFO'), - noTimeStamps = cms.untracked.bool(True), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) + cerr = cms.untracked.PSet(enable = cms.untracked.bool(False)), + files = cms.untracked.PSet( + u19d_infos = cms.untracked.PSet( + threshold = cms.untracked.string('INFO'), + noTimeStamps = cms.untracked.bool(True), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + preEventProcessing = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) + ), + u19d_debugs = cms.untracked.PSet( + threshold = cms.untracked.string('DEBUG'), + noTimeStamps = cms.untracked.bool(True), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + preEventProcessing = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) + ) ), - debugModules = cms.untracked.vstring('*'), - destinations = cms.untracked.vstring('u19d_infos', - 'u19d_debugs'), - u19d_debugs = cms.untracked.PSet( - threshold = cms.untracked.string('DEBUG'), - noTimeStamps = cms.untracked.bool(True), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) - ), - categories = cms.untracked.vstring('preEventProcessing', - 'FwkTest', - 'ridiculously_long_category_name') + debugModules = cms.untracked.vstring('*') ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u1_cfg.py b/FWCore/MessageService/test/u1_cfg.py index 5585d4efa3ef9..026f85e1576d8 100644 --- a/FWCore/MessageService/test/u1_cfg.py +++ b/FWCore/MessageService/test/u1_cfg.py @@ -14,51 +14,49 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - u1_infos = cms.untracked.PSet( - threshold = cms.untracked.string('INFO'), - noTimeStamps = cms.untracked.bool(True), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), - u1_warnings = cms.untracked.PSet( - threshold = cms.untracked.string('WARNING'), - noTimeStamps = cms.untracked.bool(True) - ), - u1_debugs = cms.untracked.PSet( - threshold = cms.untracked.string('DEBUG'), - noTimeStamps = cms.untracked.bool(True), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(0) + files = cms.untracked.PSet( + u1_infos = cms.untracked.PSet( + threshold = cms.untracked.string('INFO'), + noTimeStamps = cms.untracked.bool(True), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + preEventProcessing = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) ), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) - ), - u1_default = cms.untracked.PSet( - noTimeStamps = cms.untracked.bool(True), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(0) + u1_warnings = cms.untracked.PSet( + threshold = cms.untracked.string('WARNING'), + noTimeStamps = cms.untracked.bool(True) + ), + u1_debugs = cms.untracked.PSet( + threshold = cms.untracked.string('DEBUG'), + noTimeStamps = cms.untracked.bool(True), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + preEventProcessing = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) ), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) + u1_default = cms.untracked.PSet( + noTimeStamps = cms.untracked.bool(True), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + preEventProcessing = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) + ), + u1_errors = cms.untracked.PSet( + threshold = cms.untracked.string('ERROR'), + noTimeStamps = cms.untracked.bool(True) ) ), - u1_errors = cms.untracked.PSet( - threshold = cms.untracked.string('ERROR'), - noTimeStamps = cms.untracked.bool(True) - ), debugModules = cms.untracked.vstring('*'), - categories = cms.untracked.vstring('preEventProcessing', - 'FwkTest'), - destinations = cms.untracked.vstring('u1_warnings', - 'u1_errors', - 'u1_infos', - 'u1_debugs', - 'u1_default') ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u1d_cfg.py b/FWCore/MessageService/test/u1d_cfg.py index 102aac617c9cf..59572a8b25a08 100644 --- a/FWCore/MessageService/test/u1d_cfg.py +++ b/FWCore/MessageService/test/u1d_cfg.py @@ -15,51 +15,49 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - u1d_infos = cms.untracked.PSet( - threshold = cms.untracked.string('INFO'), - noTimeStamps = cms.untracked.bool(True), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), - u1d_warnings = cms.untracked.PSet( - threshold = cms.untracked.string('WARNING'), - noTimeStamps = cms.untracked.bool(True) + files = cms.untracked.PSet( + u1d_infos = cms.untracked.PSet( + threshold = cms.untracked.string('INFO'), + noTimeStamps = cms.untracked.bool(True), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + preEventProcessing = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) + ), + u1d_warnings = cms.untracked.PSet( + threshold = cms.untracked.string('WARNING'), + noTimeStamps = cms.untracked.bool(True) + ), + u1d_debugs = cms.untracked.PSet( + threshold = cms.untracked.string('DEBUG'), + noTimeStamps = cms.untracked.bool(True), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + preEventProcessing = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) + ), + u1d_default = cms.untracked.PSet( + noTimeStamps = cms.untracked.bool(True), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + preEventProcessing = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) + ), + u1d_errors = cms.untracked.PSet( + threshold = cms.untracked.string('ERROR'), + noTimeStamps = cms.untracked.bool(True) + ) ), - u1d_debugs = cms.untracked.PSet( - threshold = cms.untracked.string('DEBUG'), - noTimeStamps = cms.untracked.bool(True), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) - ), - u1d_default = cms.untracked.PSet( - noTimeStamps = cms.untracked.bool(True), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) - ), - u1d_errors = cms.untracked.PSet( - threshold = cms.untracked.string('ERROR'), - noTimeStamps = cms.untracked.bool(True) - ), - debugModules = cms.untracked.vstring('*'), - categories = cms.untracked.vstring('preEventProcessing', - 'FwkTest'), - destinations = cms.untracked.vstring('u1d_warnings', - 'u1d_errors', - 'u1d_infos', - 'u1d_debugs', - 'u1d_default') + debugModules = cms.untracked.vstring('*') ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u21_cfg.py b/FWCore/MessageService/test/u21_cfg.py index d8976d00b9652..459a8f4b1f6fb 100644 --- a/FWCore/MessageService/test/u21_cfg.py +++ b/FWCore/MessageService/test/u21_cfg.py @@ -15,41 +15,40 @@ limit = cms.untracked.int32(0) ) ), - u21_infos = cms.untracked.PSet( - threshold = cms.untracked.string('INFO'), - noTimeStamps = cms.untracked.bool(True), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), - categories = cms.untracked.vstring('preEventProcessing', - 'FwkTest', - 'importantInfo', - 'routineInfo'), - u21_warnings = cms.untracked.PSet( - INFO = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - FWKINFO = cms.untracked.PSet( - limit = cms.untracked.int32(0) + files = cms.untracked.PSet( + u21_infos = cms.untracked.PSet( + threshold = cms.untracked.string('INFO'), + noTimeStamps = cms.untracked.bool(True), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + preEventProcessing = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) ), - noTimeStamps = cms.untracked.bool(True), - importantInfo = cms.untracked.PSet( - limit = cms.untracked.int32(-1) - ), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - threshold = cms.untracked.string('INFO') - ), - destinations = cms.untracked.vstring('u21_warnings', - 'u21_infos') + u21_warnings = cms.untracked.PSet( + INFO = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + FWKINFO = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + noTimeStamps = cms.untracked.bool(True), + importantInfo = cms.untracked.PSet( + limit = cms.untracked.int32(-1) + ), + preEventProcessing = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + threshold = cms.untracked.string('INFO') + ) + ) ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u22_cfg.py b/FWCore/MessageService/test/u22_cfg.py index cbf7c39cd7cac..81ad16a7400c1 100644 --- a/FWCore/MessageService/test/u22_cfg.py +++ b/FWCore/MessageService/test/u22_cfg.py @@ -17,19 +17,18 @@ limit = cms.untracked.int32(0) ) ), - u22_warnings = cms.untracked.PSet( - threshold = cms.untracked.string('WARNING'), - noTimeStamps = cms.untracked.bool(True), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), - categories = cms.untracked.vstring('preEventProcessing', - 'FwkTest'), - destinations = cms.untracked.vstring('u22_warnings') + files = cms.untracked.PSet( + u22_warnings = cms.untracked.PSet( + threshold = cms.untracked.string('WARNING'), + noTimeStamps = cms.untracked.bool(True), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + ) + ) ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u23_cfg.py b/FWCore/MessageService/test/u23_cfg.py index 157d13771c301..5146c9cee4b2f 100644 --- a/FWCore/MessageService/test/u23_cfg.py +++ b/FWCore/MessageService/test/u23_cfg.py @@ -16,22 +16,19 @@ limit = cms.untracked.int32(0) ) ), - statistics = cms.untracked.vstring('u23_infos'), - u23_infos = cms.untracked.PSet( - threshold = cms.untracked.string('INFO'), - noTimeStamps = cms.untracked.bool(True), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), - categories = cms.untracked.vstring('preEventProcessing', - 'FwkTest', - 'timer', - 'trace'), - destinations = cms.untracked.vstring('u23_infos') + files = cms.untracked.PSet( + u23_infos = cms.untracked.PSet( + threshold = cms.untracked.string('INFO'), + noTimeStamps = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) + ) + ) ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u24.sh b/FWCore/MessageService/test/u24.sh index ac962b8133464..adb9074890514 100755 --- a/FWCore/MessageService/test/u24.sh +++ b/FWCore/MessageService/test/u24.sh @@ -9,7 +9,7 @@ status=0 rm -f u24.log -cmsRun -p $LOCAL_TEST_DIR/u24_cfg.py || exit $? +cmsRun -p $LOCAL_TEST_DIR/u24_cfg.py && exit $? for file in u24.log do diff --git a/FWCore/MessageService/test/u24_cfg.py b/FWCore/MessageService/test/u24_cfg.py index cb8d7f1b1d1e4..1ce4940735474 100644 --- a/FWCore/MessageService/test/u24_cfg.py +++ b/FWCore/MessageService/test/u24_cfg.py @@ -16,25 +16,26 @@ limit = cms.untracked.int32(0) ) ), - # produce SAME file u24.log via warnings config - should be ignored! - u24_warnings = cms.untracked.PSet( - threshold = cms.untracked.string('WARNING'), - noTimeStamps = cms.untracked.bool(True), - extension = cms.untracked.string('log'), - filename = cms.untracked.string('u24') - ), debugModules = cms.untracked.vstring('*'), - # produce file u24.log - u24_errors = cms.untracked.PSet( - threshold = cms.untracked.string('ERROR'), - noTimeStamps = cms.untracked.bool(True), - extension = cms.untracked.string('log'), - filename = cms.untracked.string('u24') + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), - categories = cms.untracked.vstring('preEventProcessing', - 'FwkTest'), - destinations = cms.untracked.vstring('u24_warnings', - 'u24_errors') + files = cms.untracked.PSet( + # produce SAME file u24.log via warnings config - should cause exception! + u24_warnings = cms.untracked.PSet( + threshold = cms.untracked.string('WARNING'), + noTimeStamps = cms.untracked.bool(True), + extension = cms.untracked.string('log'), + filename = cms.untracked.string('u24') + ), + # produce file u24.log + u24_errors = cms.untracked.PSet( + threshold = cms.untracked.string('ERROR'), + noTimeStamps = cms.untracked.bool(True), + extension = cms.untracked.string('log'), + filename = cms.untracked.string('u24') + ) + ) ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u25_cfg.py b/FWCore/MessageService/test/u25_cfg.py index 9ad7c1f29b4c7..70e61e12abe3d 100644 --- a/FWCore/MessageService/test/u25_cfg.py +++ b/FWCore/MessageService/test/u25_cfg.py @@ -12,21 +12,20 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - destinations = cms.untracked.vstring('u25_only'), - statistics = cms.untracked.vstring('u25_only'), - categories = cms.untracked.vstring('preEventProcessing', - 'FwkTest'), - u25_only = cms.untracked.PSet( - threshold = cms.untracked.string('INFO'), - noTimeStamps = cms.untracked.bool(True), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - ERROR = cms.untracked.PSet( - limit = cms.untracked.int32(3) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) + ), + files = cms.untracked.PSet( + u25_only = cms.untracked.PSet( + threshold = cms.untracked.string('INFO'), + noTimeStamps = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + ERROR = cms.untracked.PSet( + limit = cms.untracked.int32(3) + ) ) ) ) diff --git a/FWCore/MessageService/test/u26_cfg.py b/FWCore/MessageService/test/u26_cfg.py index da0c4d5e5c300..7ab720f8fae39 100644 --- a/FWCore/MessageService/test/u26_cfg.py +++ b/FWCore/MessageService/test/u26_cfg.py @@ -14,11 +14,15 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - u26_warnings = cms.untracked.PSet( - threshold = cms.untracked.string('WARNING'), - noTimeStamps = cms.untracked.bool(True) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), - destinations = cms.untracked.vstring('u26_warnings') + files = cms.untracked.PSet( + u26_warnings = cms.untracked.PSet( + threshold = cms.untracked.string('WARNING'), + noTimeStamps = cms.untracked.bool(True) + ) + ) ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u27_cfg.py b/FWCore/MessageService/test/u27_cfg.py index 30ff731583e4d..69b082f575e05 100644 --- a/FWCore/MessageService/test/u27_cfg.py +++ b/FWCore/MessageService/test/u27_cfg.py @@ -14,28 +14,25 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - statistics = cms.untracked.vstring('u27_infos'), messageSummaryToJobReport = cms.untracked.bool(True), default = cms.untracked.PSet( FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ) ), - u27_infos = cms.untracked.PSet( - threshold = cms.untracked.string('INFO'), - noTimeStamps = cms.untracked.bool(True), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), - categories = cms.untracked.vstring('preEventProcessing', - 'FwkTest', - 'timer', - 'trace'), - destinations = cms.untracked.vstring('u27_infos') + files = cms.untracked.PSet( + u27_infos = cms.untracked.PSet( + threshold = cms.untracked.string('INFO'), + noTimeStamps = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) + ) + ) ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u28_cerr_cfg.py b/FWCore/MessageService/test/u28_cerr_cfg.py index 6077b8cff40a6..424acf0363444 100644 --- a/FWCore/MessageService/test/u28_cerr_cfg.py +++ b/FWCore/MessageService/test/u28_cerr_cfg.py @@ -14,19 +14,9 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - categories = cms.untracked.vstring('preEventProcessing'), - destinations = cms.untracked.vstring('cerr'), - statistics = cms.untracked.vstring('cerr_stats'), - cerr_stats = cms.untracked.PSet( - threshold = cms.untracked.string('WARNING'), - output = cms.untracked.string('cerr') - ), - u28_output = cms.untracked.PSet( - threshold = cms.untracked.string('INFO'), - noTimeStamps = cms.untracked.bool(True), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) + cerr = cms.untracked.PSet( + statisticsThreshold = cms.untracked.string('WARNING'), + enableStatistics = cms.untracked.bool(True) ) ) diff --git a/FWCore/MessageService/test/u28_cfg.py b/FWCore/MessageService/test/u28_cfg.py index 2b2437de81e08..fa9bbf339a555 100644 --- a/FWCore/MessageService/test/u28_cfg.py +++ b/FWCore/MessageService/test/u28_cfg.py @@ -14,19 +14,16 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - categories = cms.untracked.vstring('preEventProcessing'), - destinations = cms.untracked.vstring('u28_output'), - statistics = cms.untracked.vstring('u28_statistics'), - u28_statistics = cms.untracked.PSet( - threshold = cms.untracked.string('WARNING'), - output = cms.untracked.string('u28_output') + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), - u28_output = cms.untracked.PSet( - threshold = cms.untracked.string('INFO'), - noTimeStamps = cms.untracked.bool(True), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) + files = cms.untracked.PSet( + u28_output = cms.untracked.PSet( + threshold = cms.untracked.string('INFO'), + noTimeStamps = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True), + statisticsThreshold = cms.untracked.string('WARNING') + ) ) ) diff --git a/FWCore/MessageService/test/u2_cfg.py b/FWCore/MessageService/test/u2_cfg.py index 0b6b1c562dd40..bd86616939535 100644 --- a/FWCore/MessageService/test/u2_cfg.py +++ b/FWCore/MessageService/test/u2_cfg.py @@ -11,12 +11,16 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - u2_warnings = cms.untracked.PSet( - threshold = cms.untracked.string('WARNING'), - noTimeStamps = cms.untracked.bool(True) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) + ), + files = cms.untracked.PSet( + u2_warnings = cms.untracked.PSet( + threshold = cms.untracked.string('WARNING'), + noTimeStamps = cms.untracked.bool(True) + ) ), generate_preconfiguration_message = cms.untracked.string('This tests a message generated before configuration'), - destinations = cms.untracked.vstring('u2_warnings') ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u30Lumi_cfg.py b/FWCore/MessageService/test/u30Lumi_cfg.py index b0aada1b13966..db55b7332c7a8 100644 --- a/FWCore/MessageService/test/u30Lumi_cfg.py +++ b/FWCore/MessageService/test/u30Lumi_cfg.py @@ -13,19 +13,18 @@ limit = cms.untracked.int32(1000) ) ), - u30_infos = cms.untracked.PSet( - threshold = cms.untracked.string('INFO'), - noTimeStamps = cms.untracked.bool(True), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(1000) - ), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), - categories = cms.untracked.vstring('preEventProcessing', - 'FwkTest'), - destinations = cms.untracked.vstring('u30_infos') + files = cms.untracked.PSet( + u30_infos = cms.untracked.PSet( + threshold = cms.untracked.string('INFO'), + noTimeStamps = cms.untracked.bool(True), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(1000) + ) + ) + ) ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u30_cfg.py b/FWCore/MessageService/test/u30_cfg.py index 7987b73cc7e2a..cc42bc383dcb8 100644 --- a/FWCore/MessageService/test/u30_cfg.py +++ b/FWCore/MessageService/test/u30_cfg.py @@ -16,19 +16,18 @@ limit = cms.untracked.int32(1000) ) ), - u30_infos = cms.untracked.PSet( - threshold = cms.untracked.string('INFO'), - noTimeStamps = cms.untracked.bool(True), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), - categories = cms.untracked.vstring('preEventProcessing', - 'FwkTest'), - destinations = cms.untracked.vstring('u30_infos') + files = cms.untracked.PSet( + u30_infos = cms.untracked.PSet( + threshold = cms.untracked.string('INFO'), + noTimeStamps = cms.untracked.bool(True), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) + ) + ) ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u31_cfg.py b/FWCore/MessageService/test/u31_cfg.py index ad58a269bb0a0..3b2f8b2092571 100644 --- a/FWCore/MessageService/test/u31_cfg.py +++ b/FWCore/MessageService/test/u31_cfg.py @@ -14,22 +14,22 @@ limit = cms.untracked.int32(0) ) ), - statistics = cms.untracked.vstring('u31_infos'), - u31_infos = cms.untracked.PSet( - threshold = cms.untracked.string('INFO'), - noTimeStamps = cms.untracked.bool(True), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), - categories = cms.untracked.vstring('preEventProcessing', - 'FwkTest', - 'timer', - 'trace'), - destinations = cms.untracked.vstring('u31_infos') + files = cms.untracked.PSet( + u31_infos = cms.untracked.PSet( + threshold = cms.untracked.string('INFO'), + noTimeStamps = cms.untracked.bool(True), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + preEventProcessing = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + enableStatistics = cms.untracked.bool(True) + ) + ) ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u33_cfg.py b/FWCore/MessageService/test/u33_cfg.py index 0a8064f9d66c4..68bee2dbf168a 100644 --- a/FWCore/MessageService/test/u33_cfg.py +++ b/FWCore/MessageService/test/u33_cfg.py @@ -10,18 +10,21 @@ process.options = FWCore.Framework.test.cmsExceptionsFatal_cff.options process.MessageLogger = cms.Service("MessageLogger", - destinations = cms.untracked.vstring('u33_all'), - statistics = cms.untracked.vstring('u33_all'), - categories = cms.untracked.vstring('cat_A'), suppressInfo = cms.untracked.vstring('ssm_2a'), - debugModules = cms.untracked.vstring('ssm_1b'), - u33_all = cms.untracked.PSet( - threshold = cms.untracked.string('DEBUG'), - noTimeStamps = cms.untracked.bool(True), - default = cms.untracked.PSet( - limit = cms.untracked.int32(-1) - ), + debugModules = cms.untracked.vstring('ssm_1b'), + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), + files = cms.untracked.PSet( + u33_all = cms.untracked.PSet( + threshold = cms.untracked.string('DEBUG'), + noTimeStamps = cms.untracked.bool(True), + default = cms.untracked.PSet( + limit = cms.untracked.int32(-1) + ), + enableStatistics = cms.untracked.bool(True) + ) + ) ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u33d_cfg.py b/FWCore/MessageService/test/u33d_cfg.py index 8d50db9d18d27..d9f68ff15fed1 100644 --- a/FWCore/MessageService/test/u33d_cfg.py +++ b/FWCore/MessageService/test/u33d_cfg.py @@ -10,18 +10,21 @@ process.options = FWCore.Framework.test.cmsExceptionsFatal_cff.options process.MessageLogger = cms.Service("MessageLogger", - destinations = cms.untracked.vstring('u33d_all'), - statistics = cms.untracked.vstring('u33d_all'), - categories = cms.untracked.vstring('cat_A'), - suppressInfo = cms.untracked.vstring('ssm_2a'), - debugModules = cms.untracked.vstring('ssm_1b'), - u33d_all = cms.untracked.PSet( - threshold = cms.untracked.string('DEBUG'), - noTimeStamps = cms.untracked.bool(True), - default = cms.untracked.PSet( - limit = cms.untracked.int32(-1) - ), + suppressInfo = cms.untracked.vstring('ssm_2a'), + debugModules = cms.untracked.vstring('ssm_1b'), + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(True) ), + files = cms.untracked.PSet( + u33d_all = cms.untracked.PSet( + threshold = cms.untracked.string('DEBUG'), + noTimeStamps = cms.untracked.bool(True), + default = cms.untracked.PSet( + limit = cms.untracked.int32(-1) + ), + enableStatistics = cms.untracked.bool(True) + ) + ) ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u34_cfg.py b/FWCore/MessageService/test/u34_cfg.py index b131be870c3fb..4473aaed5e756 100644 --- a/FWCore/MessageService/test/u34_cfg.py +++ b/FWCore/MessageService/test/u34_cfg.py @@ -15,11 +15,14 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - u34_warnings = cms.untracked.PSet( - threshold = cms.untracked.string('WARNING'), - noTimeStamps = cms.untracked.bool(True) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), - destinations = cms.untracked.vstring('u34_warnings', + files = cms.untracked.PSet( + u34_warnings = cms.untracked.PSet( + threshold = cms.untracked.string('WARNING'), + noTimeStamps = cms.untracked.bool(True) + ) ) ) diff --git a/FWCore/MessageService/test/u35_cfg.py b/FWCore/MessageService/test/u35_cfg.py index dea460323bd2c..a77269885cbcf 100644 --- a/FWCore/MessageService/test/u35_cfg.py +++ b/FWCore/MessageService/test/u35_cfg.py @@ -14,16 +14,18 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - u35_warnings = cms.untracked.PSet( - threshold = cms.untracked.string('WARNING'), - noTimeStamps = cms.untracked.bool(True) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), - u35_infos = cms.untracked.PSet( - threshold = cms.untracked.string('INFO'), - noTimeStamps = cms.untracked.bool(True) - ), - destinations = cms.untracked.vstring('u35_warnings', - 'u35_infos' + files = cms.untracked.PSet( + u35_warnings = cms.untracked.PSet( + threshold = cms.untracked.string('WARNING'), + noTimeStamps = cms.untracked.bool(True) + ), + u35_infos = cms.untracked.PSet( + threshold = cms.untracked.string('INFO'), + noTimeStamps = cms.untracked.bool(True) + ) ) ) diff --git a/FWCore/MessageService/test/u36_cfg.py b/FWCore/MessageService/test/u36_cfg.py index cf01778b1bdb2..cf30710321070 100644 --- a/FWCore/MessageService/test/u36_cfg.py +++ b/FWCore/MessageService/test/u36_cfg.py @@ -14,16 +14,20 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - u36_only = cms.untracked.PSet( - threshold = cms.untracked.string('INFO'), - INFO = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - WARNING = cms.untracked.PSet( - limit = cms.untracked.int32(-1) - ) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), - destinations = cms.untracked.vstring('u36_only') + files = cms.untracked.PSet( + u36_only = cms.untracked.PSet( + threshold = cms.untracked.string('INFO'), + INFO = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + WARNING = cms.untracked.PSet( + limit = cms.untracked.int32(-1) + ) + ) + ) ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u3_cfg.py b/FWCore/MessageService/test/u3_cfg.py index e3c85812ddac8..5cd43083b1e08 100644 --- a/FWCore/MessageService/test/u3_cfg.py +++ b/FWCore/MessageService/test/u3_cfg.py @@ -12,20 +12,24 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - u3_infos = cms.untracked.PSet( - threshold = cms.untracked.string('INFO'), - noTimeStamps = cms.untracked.bool(True), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(0) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) + ), + files = cms.untracked.PSet( + u3_infos = cms.untracked.PSet( + threshold = cms.untracked.string('INFO'), + noTimeStamps = cms.untracked.bool(True), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) ), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) + u3_statistics = cms.untracked.PSet( + enableStatistics = cms.untracked.bool(True), + default = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) ) - ), - statistics = cms.untracked.vstring('u3_statistics'), - categories = cms.untracked.vstring('preEventProcessing', - 'FwkTest'), - destinations = cms.untracked.vstring('u3_infos') + ) ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u4_cfg.py b/FWCore/MessageService/test/u4_cfg.py index f1c2acdcb8d78..6ef77e572f49f 100644 --- a/FWCore/MessageService/test/u4_cfg.py +++ b/FWCore/MessageService/test/u4_cfg.py @@ -12,24 +12,30 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - u4_statistics = cms.untracked.PSet( - threshold = cms.untracked.string('WARNING') + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), - statistics = cms.untracked.vstring('u4_statistics', - 'anotherStats', - 'u4_errors'), - u4_errors = cms.untracked.PSet( - threshold = cms.untracked.string('ERROR'), - noTimeStamps = cms.untracked.bool(True), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) + files = cms.untracked.PSet( + u4_statistics = cms.untracked.PSet( + threshold = cms.untracked.string('WARNING'), + default = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + enableStatistics = cms.untracked.bool(True) + ), + u4_errors = cms.untracked.PSet( + threshold = cms.untracked.string('ERROR'), + noTimeStamps = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True) + ), + anotherStats = cms.untracked.PSet( + output = cms.untracked.string('u4_another'), + enableStatistics = cms.untracked.bool(True), + default = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) ) - ), - anotherStats = cms.untracked.PSet( - output = cms.untracked.string('u4_another') - ), - categories = cms.untracked.vstring('preEventProcessing'), - destinations = cms.untracked.vstring('u4_errors') + ) ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u5_cfg.py b/FWCore/MessageService/test/u5_cfg.py index 29de18a570eb1..9a2652e047055 100644 --- a/FWCore/MessageService/test/u5_cfg.py +++ b/FWCore/MessageService/test/u5_cfg.py @@ -12,24 +12,35 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - statistics = cms.untracked.vstring('u5_default', - 'u5_reset', - 'u5_noreset'), - u5_errors = cms.untracked.PSet( - threshold = cms.untracked.string('ERROR'), - noTimeStamps = cms.untracked.bool(True), - preEventProcessing = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) - ), - categories = cms.untracked.vstring('preEventProcessing'), - u5_noreset = cms.untracked.PSet( - reset = cms.untracked.bool(False) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), - u5_reset = cms.untracked.PSet( - reset = cms.untracked.bool(True) - ), - destinations = cms.untracked.vstring('u5_errors') + files = cms.untracked.PSet( + u5_errors = cms.untracked.PSet( + threshold = cms.untracked.string('ERROR'), + noTimeStamps = cms.untracked.bool(True), + ), + u5_default = cms.untracked.PSet( + enableStatistics = cms.untracked.bool(True), + default = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) + ), + u5_noreset = cms.untracked.PSet( + resetStatistics = cms.untracked.bool(False), + enableStatistics = cms.untracked.bool(True), + default = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) + ), + u5_reset = cms.untracked.PSet( + resetStatistics = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True), + default = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) + ) + ) ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u6_cfg.py b/FWCore/MessageService/test/u6_cfg.py index f6bfae9b3b99b..1ed12a0711119 100644 --- a/FWCore/MessageService/test/u6_cfg.py +++ b/FWCore/MessageService/test/u6_cfg.py @@ -11,11 +11,15 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - u6_warnings = cms.untracked.PSet( - threshold = cms.untracked.string('WARNING'), - noTimeStamps = cms.untracked.bool(True) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), - destinations = cms.untracked.vstring('u6_warnings') + files = cms.untracked.PSet( + u6_warnings = cms.untracked.PSet( + threshold = cms.untracked.string('WARNING'), + noTimeStamps = cms.untracked.bool(True) + ) + ) ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u7_cfg.py b/FWCore/MessageService/test/u7_cfg.py index 2da2ab11c88b2..d9d5229f64331 100644 --- a/FWCore/MessageService/test/u7_cfg.py +++ b/FWCore/MessageService/test/u7_cfg.py @@ -11,25 +11,26 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", - u7_restrict = cms.untracked.PSet( - default = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - noTimeStamps = cms.untracked.bool(True), - special = cms.untracked.PSet( - limit = cms.untracked.int32(-1) - ) + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) ), - u7_log = cms.untracked.PSet( - noTimeStamps = cms.untracked.bool(True), - FwkTest = cms.untracked.PSet( - limit = cms.untracked.int32(0) + files = cms.untracked.PSet( + u7_restrict = cms.untracked.PSet( + default = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + noTimeStamps = cms.untracked.bool(True), + special = cms.untracked.PSet( + limit = cms.untracked.int32(-1) + ) + ), + u7_log = cms.untracked.PSet( + noTimeStamps = cms.untracked.bool(True), + FwkTest = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) ) - ), - destinations = cms.untracked.vstring('u7_log', - 'u7_restrict'), - categories = cms.untracked.vstring('FwkTest', - 'special') + ) ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u8_cfg.py b/FWCore/MessageService/test/u8_cfg.py index ef7b84881ceb8..bf48500bdc1b5 100644 --- a/FWCore/MessageService/test/u8_cfg.py +++ b/FWCore/MessageService/test/u8_cfg.py @@ -18,6 +18,9 @@ process.load("FWCore.MessageService.test.Services_cff") process.MessageLogger = cms.Service("MessageLogger", + cerr = cms.untracked.PSet( + enable = cms.untracked.bool(False) + ), default = cms.untracked.PSet( expect_specific = cms.untracked.PSet( limit = cms.untracked.int32(0) @@ -46,84 +49,71 @@ limit = cms.untracked.int32(0) ) ), - u8_non_supercede_common = cms.untracked.PSet( - default = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - expect_non_supercede_common_specific = cms.untracked.PSet( - limit = cms.untracked.int32(-1) - ), - noTimeStamps = cms.untracked.bool(True) - ), - u8_supercede_specific = cms.untracked.PSet( - default = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - lim2bycommondefault = cms.untracked.PSet( - limit = cms.untracked.int32(8) - ), - noTimeStamps = cms.untracked.bool(True), - expect_supercede_specific = cms.untracked.PSet( - limit = cms.untracked.int32(-1) - ) - ), - u8_overall_unnamed = cms.untracked.PSet( - lim3bydefault = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - noTimeStamps = cms.untracked.bool(True), - lim2bycommondefault = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - expect_overall_unnamed = cms.untracked.PSet( - limit = cms.untracked.int32(-1) + files = cms.untracked.PSet( + u8_non_supercede_common = cms.untracked.PSet( + default = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + expect_non_supercede_common_specific = cms.untracked.PSet( + limit = cms.untracked.int32(-1) + ), + noTimeStamps = cms.untracked.bool(True) + ), + u8_supercede_specific = cms.untracked.PSet( + default = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + lim2bycommondefault = cms.untracked.PSet( + limit = cms.untracked.int32(8) + ), + noTimeStamps = cms.untracked.bool(True), + expect_supercede_specific = cms.untracked.PSet( + limit = cms.untracked.int32(-1) + ) + ), + u8_overall_unnamed = cms.untracked.PSet( + lim3bydefault = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + noTimeStamps = cms.untracked.bool(True), + lim2bycommondefault = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + expect_overall_unnamed = cms.untracked.PSet( + limit = cms.untracked.int32(-1) + ) + ), + u8_specific = cms.untracked.PSet( + default = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + expect_specific = cms.untracked.PSet( + limit = cms.untracked.int32(-1) + ), + noTimeStamps = cms.untracked.bool(True), + lim2bycommondefault = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + lim0bydefaults = cms.untracked.PSet( + limit = cms.untracked.int32(6) + ) + ), + u8_overall_specific = cms.untracked.PSet( + lim3bydefault = cms.untracked.PSet( + limit = cms.untracked.int32(3) + ), + default = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ), + noTimeStamps = cms.untracked.bool(True), + expect_overall_specific = cms.untracked.PSet( + limit = cms.untracked.int32(-1) + ), + lim2bycommondefault = cms.untracked.PSet( + limit = cms.untracked.int32(0) + ) ) - ), - u8_specific = cms.untracked.PSet( - default = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - expect_specific = cms.untracked.PSet( - limit = cms.untracked.int32(-1) - ), - noTimeStamps = cms.untracked.bool(True), - lim2bycommondefault = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - lim0bydefaults = cms.untracked.PSet( - limit = cms.untracked.int32(6) - ) - ), - u8_overall_specific = cms.untracked.PSet( - lim3bydefault = cms.untracked.PSet( - limit = cms.untracked.int32(3) - ), - default = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ), - noTimeStamps = cms.untracked.bool(True), - expect_overall_specific = cms.untracked.PSet( - limit = cms.untracked.int32(-1) - ), - lim2bycommondefault = cms.untracked.PSet( - limit = cms.untracked.int32(0) - ) - ), - categories = cms.untracked.vstring('preEventProcessing', - 'lim3bydefault', - 'lim2bycommondefault', - 'lim0bydefaults', - 'expect_overall_unnamed', - 'expect_overall_specific', - 'expect_supercede_specific', - 'expect_non_supercede_common_specific', - 'expect_specific', - 'FwkTest'), - destinations = cms.untracked.vstring('u8_overall_unnamed', - 'u8_overall_specific', - 'u8_supercede_specific', - 'u8_non_supercede_common', - 'u8_specific') + ) ) process.maxEvents = cms.untracked.PSet( diff --git a/FWCore/MessageService/test/u9_cfg.py b/FWCore/MessageService/test/u9_cfg.py index 78855aa34f0e8..da849f501641d 100644 --- a/FWCore/MessageService/test/u9_cfg.py +++ b/FWCore/MessageService/test/u9_cfg.py @@ -13,7 +13,7 @@ process.load("FWCore.MessageService.MessageLogger_cfi") process.MessageLogger.destinations = ['warnings', 'infos'] -process.MessageLogger.statistics = ['warnings', 'infos'] +del process.MessageLogger.statistics process.MessageLogger.categories.append('FwkTest') process.MessageLogger.default = cms.untracked.PSet( noTimeStamps = cms.untracked.bool(False), @@ -24,6 +24,7 @@ ) process.MessageLogger.warnings = cms.untracked.PSet( threshold = cms.untracked.string('WARNING'), + enableStatistics = cms.untracked.bool(True), default = cms.untracked.PSet( limit = cms.untracked.int32(3) ), @@ -34,6 +35,7 @@ limit = cms.untracked.int32(2) ), noTimeStamps = cms.untracked.bool(True), + enableStatistics = cms.untracked.bool(True), FwkTest = cms.untracked.PSet( limit = cms.untracked.int32(0) ) diff --git a/FWCore/MessageService/test/unit_test_outputs/u24.log b/FWCore/MessageService/test/unit_test_outputs/u24.log index e9ef24ee7c301..f21fa879cb0ab 100644 --- a/FWCore/MessageService/test/unit_test_outputs/u24.log +++ b/FWCore/MessageService/test/unit_test_outputs/u24.log @@ -1,28 +1,8 @@ -%MSG-e duplicateDestination: (NoModuleName) pre-events +----- Begin Fatal Exception {Timestamp} ---------------------- +An exception of category 'DuplicateDestination' occurred while + [0] Constructing the EventProcessor + [1] Constructing service of type MessageLogger +Exception Message: Duplicate name for a MessageLogger Destination: u24.log -Only the first configuration instructions are used -%MSG -%MSG-e cat_A: UnitTestClient_A:sendSomeMessages Run: 1 Event: 1 -LogError was used to send this message-which is long enough to span lines but-will not be broken up by the logger any more -%MSG -%MSG-e cat_B: UnitTestClient_A:sendSomeMessages Run: 1 Event: 1 -LogError was used to send this other message -%MSG -%MSG-w cat_A: UnitTestClient_A:sendSomeMessages Run: 1 Event: 1 -LogWarning was used to send this message -%MSG -%MSG-w cat_B: UnitTestClient_A:sendSomeMessages Run: 1 Event: 1 -LogWarning was used to send this other message -%MSG -%MSG-e cat_A: UnitTestClient_A:sendSomeMessages Run: 1 Event: 2 -LogError was used to send this message-which is long enough to span lines but-will not be broken up by the logger any more -%MSG -%MSG-e cat_B: UnitTestClient_A:sendSomeMessages Run: 1 Event: 2 -LogError was used to send this other message -%MSG -%MSG-w cat_A: UnitTestClient_A:sendSomeMessages Run: 1 Event: 2 -LogWarning was used to send this message -%MSG -%MSG-w cat_B: UnitTestClient_A:sendSomeMessages Run: 1 Event: 2 -LogWarning was used to send this other message -%MSG +Please modify the configuration to use unique file names. +----- End Fatal Exception ------------------------------------------------- diff --git a/FWCore/ParameterSet/interface/ParameterWildcardWithSpecifics.h b/FWCore/ParameterSet/interface/ParameterWildcardWithSpecifics.h new file mode 100644 index 0000000000000..77075c07466dd --- /dev/null +++ b/FWCore/ParameterSet/interface/ParameterWildcardWithSpecifics.h @@ -0,0 +1,42 @@ + +#ifndef FWCore_ParameterSet_ParameterWildcardWithSpecifics_h +#define FWCore_ParameterSet_ParameterWildcardWithSpecifics_h + +#include +#include +#include "FWCore/ParameterSet/interface/ParameterWildcardBase.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" + +namespace edm { + + class ParameterSet; + class DocFormatHelper; + + class ParameterWildcardWithSpecifics : public ParameterWildcardBase { + public: + ParameterWildcardWithSpecifics(std::string_view, + WildcardValidationCriteria criteria, + bool isTracked, + ParameterSetDescription const& desc, + std::map exceptions); + + ParameterDescriptionNode* clone() const override; + + private: + void validate_(ParameterSet& pset, std::set& validatedLabels, bool optional) const override; + + bool hasNestedContent_() const override; + + void printNestedContent_(std::ostream& os, bool optional, DocFormatHelper& dfh) const override; + + bool exists_(ParameterSet const& pset) const override; + + void validatePSetVector(std::string const& parameterName, ParameterSet& pset) const; + + void validateDescription(std::string const& parameterName, ParameterSet& pset) const; + + ParameterSetDescription wildcardDesc_; + std::map exceptions_; + }; +} // namespace edm +#endif diff --git a/FWCore/ParameterSet/src/ParameterWildcardWithSpecifics.cc b/FWCore/ParameterSet/src/ParameterWildcardWithSpecifics.cc new file mode 100644 index 0000000000000..5193951ac202b --- /dev/null +++ b/FWCore/ParameterSet/src/ParameterWildcardWithSpecifics.cc @@ -0,0 +1,101 @@ +#include "FWCore/ParameterSet/interface/ParameterWildcardWithSpecifics.h" + +#include "FWCore/ParameterSet/interface/DocFormatHelper.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/ParameterSet/interface/VParameterSetEntry.h" +#include "FWCore/Utilities/interface/Algorithms.h" + +#include +#include +#include + +namespace edm { + + ParameterWildcardWithSpecifics::ParameterWildcardWithSpecifics( + std::string_view pattern, + WildcardValidationCriteria criteria, + bool isTracked, + ParameterSetDescription const& desc, + std::map exceptions) + : ParameterWildcardBase(k_PSet, isTracked, criteria), wildcardDesc_(desc), exceptions_(std::move(exceptions)) { + throwIfInvalidPattern(std::string(pattern)); + } + + ParameterDescriptionNode* ParameterWildcardWithSpecifics::clone() const { + return new ParameterWildcardWithSpecifics(*this); + } + + void ParameterWildcardWithSpecifics::validate_(ParameterSet& pset, + std::set& validatedLabels, + bool optional) const { + std::vector parameterNames = pset.getParameterNamesForType(isTracked()); + validateMatchingNames(parameterNames, validatedLabels, optional); + + for (auto const& name : parameterNames) { + validateDescription(name, pset); + } + //inject exceptions if not already in the pset + for (auto const& v : exceptions_) { + if (std::find(parameterNames.begin(), parameterNames.end(), v.first) == parameterNames.end()) { + if (isTracked()) { + pset.addParameter(v.first, edm::ParameterSet()); + } else { + pset.addUntrackedParameter(v.first, edm::ParameterSet()); + } + validatedLabels.insert(v.first); + validateDescription(v.first, pset); + } + } + } + + void ParameterWildcardWithSpecifics::validateDescription(std::string const& parameterName, ParameterSet& pset) const { + ParameterSet* containedPSet = pset.getPSetForUpdate(parameterName); + auto itFound = exceptions_.find(parameterName); + if (itFound != exceptions_.end()) { + itFound->second.validate(*containedPSet); + } else { + wildcardDesc_.validate(*containedPSet); + } + } + + bool ParameterWildcardWithSpecifics::hasNestedContent_() const { return true; } + + void ParameterWildcardWithSpecifics::printNestedContent_(std::ostream& os, + bool /*optional*/, + DocFormatHelper& dfh) const { + int indentation = dfh.indentation(); + if (dfh.parent() != DocFormatHelper::TOP) { + indentation -= DocFormatHelper::offsetSectionContent(); + } + + printSpaces(os, indentation); + os << "Section " << dfh.section() << "." << dfh.counter() << " description of PSet matching wildcard:"; + os << "\n"; + if (!dfh.brief()) + os << "\n"; + + std::stringstream ss; + ss << dfh.section() << "." << dfh.counter(); + std::string newSection = ss.str(); + + DocFormatHelper new_dfh(dfh); + new_dfh.setSection(newSection); + new_dfh.setIndentation(indentation + DocFormatHelper::offsetSectionContent()); + new_dfh.setParent(DocFormatHelper::OTHER); + + wildcardDesc_.print(os, new_dfh); + //NOTE: need to extend to also include the specific cases. + } + + bool ParameterWildcardWithSpecifics::exists_(ParameterSet const& pset) const { + if (criteria() == RequireZeroOrMore) + return true; + + std::vector parameterNames = pset.getParameterNamesForType(isTracked()); + + if (criteria() == RequireAtLeastOne) + return !parameterNames.empty(); + return parameterNames.size() == 1U; + } + +} // namespace edm diff --git a/FWCore/ParameterSet/test/parameterSetDescription_t.cc b/FWCore/ParameterSet/test/parameterSetDescription_t.cc index bae53d53da647..408e8e9cdaa84 100644 --- a/FWCore/ParameterSet/test/parameterSetDescription_t.cc +++ b/FWCore/ParameterSet/test/parameterSetDescription_t.cc @@ -10,6 +10,7 @@ #include "FWCore/ParameterSet/interface/ParameterDescriptionBase.h" #include "FWCore/ParameterSet/interface/ParameterDescriptionNode.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/ParameterSet/interface/ParameterWildcardWithSpecifics.h" #include "FWCore/ParameterSet/interface/allowedValues.h" #include "FWCore/ParameterSet/interface/PluginDescription.h" #include "FWCore/ParameterSet/interface/ValidatedPluginMacros.h" @@ -296,6 +297,54 @@ namespace testParameterSetDescription { return; } + void testWildcardWithExceptions() { + { + edm::ParameterSetDescription set; + + edm::ParameterSetDescription wild; + wild.addUntracked("n11", 1); + + edm::ParameterSetDescription except_; + except_.addUntracked("f", 3.14); + std::map excptions = {{"special", except_}}; + edm::ParameterWildcardWithSpecifics w("*", edm::RequireZeroOrMore, true, wild, std::move(excptions)); + set.addNode(w); + edm::ParameterSet pset; + testDesc(w, set, pset, true, true); + edm::ParameterSet nested1; + nested1.addUntrackedParameter("n11", 3); + pset.addParameter("nested1", nested1); + testDesc(w, set, pset, true, true); + edm::ParameterSet special; + special.addUntrackedParameter("f", 5); + pset.addParameter("special", special); + testDesc(w, set, pset, true, true); + } + + { + edm::ParameterSetDescription set; + + edm::ParameterSetDescription wild; + wild.add("n11", 1); + + edm::ParameterSetDescription except_; + except_.add("f", 3.14); + std::map excptions = {{"special", except_}}; + edm::ParameterWildcardWithSpecifics w("*", edm::RequireZeroOrMore, true, wild, std::move(excptions)); + set.addNode(w); + edm::ParameterSet pset; + testDesc(w, set, pset, true, true); + edm::ParameterSet nested1; + nested1.addParameter("n11", 3); + pset.addParameter("nested1", nested1); + testDesc(w, set, pset, true, true); + edm::ParameterSet special; + special.addParameter("f", 5); + pset.addParameter("special", special); + testDesc(w, set, pset, true, true); + } + } + // --------------------------------------------------------------------------------- void testAllowedValues() { @@ -1723,6 +1772,7 @@ int main(int, char**) try { psetDesc.validate(pset); testParameterSetDescription::testWildcards(); + testParameterSetDescription::testWildcardWithExceptions(); testParameterSetDescription::testSwitch(); testParameterSetDescription::testAllowedValues(); testParameterSetDescription::testXor();