31 messageLoggerPSet(
pset);
48 suppressionLists(
pset);
52 vStringsCheck(
pset,
"MessageLogger");
56 check<bool>(
pset,
"MessageLogger",
"messageSummaryToJobReport");
57 std::string dumps = check<std::string>(
pset,
"MessageLogger",
"generate_preconfiguration_message");
60 validateThreshold(
thresh,
"MessageLogger");
61 check<unsigned int>(
pset,
"MessageLogger",
"waiting_threshold");
65 destinationPSets(
pset);
67 statisticsPSets(
pset);
68 fwkJobReportPSets(
pset);
69 categoryPSets(
pset,
"MessageLogger");
77 noneExcept<int>(
pset,
"MessageLogger",
"int");
78 noneExcept<unsigned int>(
pset,
"MessageLogger",
"unsigned int",
"waiting_threshold");
79 noneExcept<bool>(
pset,
"MessageLogger",
"bool",
"messageSummaryToJobReport");
82 noneExcept<float>(
pset,
"MessageLogger",
"float");
83 noneExcept<double>(
pset,
"MessageLogger",
"double");
84 noneExcept<std::string>(
pset,
"MessageLogger",
"string",
"threshold",
"generate_preconfiguration_message");
88 if (!flaws.str().empty()) {
89 flaws <<
"\nThe above are from MessageLogger configuration validation.\n"
90 <<
"In most cases, these involve lines that the logger configuration code\n"
91 <<
"would not process, but which the cfg creator obviously meant to have "
99 noDuplicates(
destinations,
"MessageLogger",
"destinations");
100 noKeywords(
destinations,
"MessageLogger",
"destinations");
105 noDuplicates(
statistics,
"MessageLogger",
"statistics");
106 noKeywords(
statistics,
"MessageLogger",
"statistics");
110 noDuplicates(
fwkJobReports,
"MessageLogger",
"fwkJobReports");
117 noDuplicates(
categories,
"MessageLogger",
"categories");
118 noKeywords(
categories,
"MessageLogger",
"categories");
124 messageIDs = check<vString>(
pset,
"MessageLogger",
"messageIDs");
125 noDuplicates(messageIDs,
"MessageLogger",
"messageIDs");
126 noKeywords(messageIDs,
"MessageLogger",
"messageIDs");
127 noNonPSetUsage(
pset, messageIDs,
"MessageLogger",
"messageIDs");
128 noDuplicates(messageIDs,
destinations,
"MessageLogger",
"messageIDs",
"destinations");
129 noDuplicates(messageIDs,
statistics,
"MessageLogger",
"messageIDs",
"statistics");
130 noDuplicates(messageIDs,
fwkJobReports,
"MessageLogger",
"messageIDs",
"fwkJobReports");
131 noDuplicates(messageIDs,
fwkJobReports,
"MessageLogger",
"messageIDs",
"categories");
139 flaws <<
"MessageLogger"
141 <<
"debugModules contains wildcard character *"
142 <<
" and also " <<
debugModules.size() - 1 <<
" other entries - * must be alone\n";
146 flaws <<
"MessageLogger"
148 <<
"suppressDebug contains modules, but debugModules is not *\n"
149 <<
"Unless all the debugModules are enabled,\n"
150 <<
"suppressing specific modules is meaningless\n";
153 flaws <<
"MessageLogger"
155 <<
"Use of wildcard (*) in suppressDebug is not supported\n"
156 <<
"By default, LogDebug is suppressed for all modules\n";
160 flaws <<
"MessageLogger"
162 <<
"Use of wildcard (*) in suppressInfo is not supported\n";
166 flaws <<
"MessageLogger"
168 <<
"Use of wildcard (*) in suppressWarning is not supported\n";
170 suppressError = check<vString>(
pset,
"MessageLogger",
"suppressError");
171 if (wildcard(suppressError)) {
172 flaws <<
"MessageLogger"
174 <<
"Use of wildcard (*) in suppressError is not supported\n";
182 vString::const_iterator
end = vStrings.end();
183 for (vString::const_iterator
i = vStrings.begin();
i !=
end; ++
i) {
184 if (!allowedVstring(*
i)) {
185 flaws <<
"MessageLogger"
187 << (*i) <<
" is used as a vstring, "
188 <<
"but no such vstring is recognized\n";
191 vStrings =
pset.getParameterNamesForType<
vString>(
true);
192 end = vStrings.end();
193 for (vString::const_iterator
i = vStrings.begin();
i !=
end; ++
i) {
194 flaws <<
"MessageLogger"
196 << (*i) <<
" is used as a tracked vstring: "
197 <<
"tracked parameters not allowed here\n";
202 if (
s ==
"destinations")
204 if (
s ==
"statistics")
206 if (
s ==
"destinations")
208 if (
s ==
"fwkJobReports")
210 if (
s ==
"categories")
212 if (
s ==
"messageIDs")
214 if (
s ==
"debugModules")
216 if (
s ==
"suppressInfo")
218 if (
s ==
"suppressDebug")
220 if (
s ==
"suppressWarning")
222 if (
s ==
"suppressError")
229 if (checkThreshold(
thresh))
231 flaws << psetName <<
" PSet: \n"
232 <<
"threshold has value " <<
thresh <<
" which is not among {DEBUG, INFO, WARNING, ERROR}\n";
251 vString::const_iterator
end =
v.end();
252 for (vString::const_iterator
i =
v.begin();
i !=
end; ++
i) {
253 for (vString::const_iterator
j =
i + 1;
j !=
end; ++
j) {
255 flaws << psetName <<
" PSet: \n"
256 <<
"in vString " << parameterLabel <<
" duplication of the string " << *
i <<
"\n";
267 vString::const_iterator end1 = v1.end();
268 vString::const_iterator end2 = v2.end();
269 for (vString::const_iterator
i = v1.begin();
i != end1; ++
i) {
270 for (vString::const_iterator
j = v2.begin();
j != end2; ++
j) {
272 flaws << psetName <<
" PSet: \n"
273 <<
"in vStrings " <<
p1 <<
" and " <<
p2 <<
" duplication of the string " << *
i <<
"\n";
282 vString::const_iterator
end =
v.end();
283 bool coutPresent =
false;
284 bool cerrPresent =
false;
285 for (vString::const_iterator
i =
v.begin();
i !=
end; ++
i) {
291 if (coutPresent && cerrPresent) {
292 flaws << psetName <<
" PSet: \n"
293 <<
"vString " << parameterLabel <<
" has both cout and cerr \n";
300 vString::const_iterator
end =
v.end();
301 for (vString::const_iterator
i =
v.begin();
i !=
end; ++
i) {
302 if (!keywordCheck(*
i)) {
303 flaws << psetName <<
" PSet: \n"
304 <<
"vString " << parameterLabel <<
" should not contain the keyword " << *
i <<
"\n";
310 if (
word ==
"default")
312 if (
word ==
"categories")
314 if (
word ==
"messageIDs")
316 if (
word ==
"fwkJobReports")
318 if (
word ==
"destinations")
320 if (
word ==
"statistics")
322 if (
word ==
"debugModules")
324 if (
word ==
"suppressInfo")
326 if (
word ==
"suppressDebug")
328 if (
word ==
"suppressWarning")
330 if (
word ==
"suppressError")
332 if (
word ==
"threshold")
336 if (
word ==
"WARNING")
342 if (
word ==
"placeholder")
346 if (
word ==
"reportEvery")
348 if (
word ==
"timespan")
350 if (
word ==
"noLineBreaks")
352 if (
word ==
"lineLength")
354 if (
word ==
"noTimeStamps")
356 if (
word ==
"output")
358 if (
word ==
"filename")
360 if (
word ==
"extension")
364 if (
word ==
"optionalPSet")
373 disallowedParam<int>(
pset,
v, psetName, parameterLabel,
"int");
374 disallowedParam<unsigned int>(
pset,
v, psetName, parameterLabel,
"uint");
375 disallowedParam<bool>(
pset,
v, psetName, parameterLabel,
"bool");
376 disallowedParam<float>(
pset,
v, psetName, parameterLabel,
"float");
377 disallowedParam<double>(
pset,
v, psetName, parameterLabel,
"double");
378 disallowedParam<std::string>(
pset,
v, psetName, parameterLabel,
"string");
379 disallowedParam<std::vector<std::string> >(
pset,
v, psetName, parameterLabel,
"vstring");
387 vString::const_iterator end1 =
v.end();
388 vString::const_iterator end2 =
params.end();
389 for (vString::const_iterator
i =
v.begin();
i != end1; ++
i) {
390 for (vString::const_iterator
j =
params.begin();
j != end2; ++
j) {
392 flaws << psetName <<
" PSet: \n"
393 << *
i <<
" (listed in vstring " << parameterLabel <<
")\n"
394 <<
"is used as a parameter of type " <<
type <<
" instead of as a PSet \n";
402 vString::const_iterator
end =
v.end();
403 for (vString::const_iterator
i =
v.begin();
i !=
end; ++
i) {
412 pset.getParameterSetNames(psnames,
false);
413 vString::const_iterator
end = psnames.end();
414 for (vString::const_iterator
i = psnames.begin();
i !=
end; ++
i) {
423 if (lookForMatch(messageIDs, *
i))
425 if ((*
i) ==
"default")
428 bool ok_optionalPSet =
false;
437 flaws <<
"MessageLogger "
439 << *
i <<
" is an unrecognized name for a PSet\n";
442 unsigned int n =
pset.getParameterSetNames(psnames,
true);
445 for (vString::const_iterator
i = psnames.begin();
i !=
end; ++
i) {
446 flaws <<
"MessageLogger "
448 <<
"PSet " << *
i <<
" is tracked - not allowed\n";
454 vString::const_iterator
begin =
v.begin();
455 vString::const_iterator
end =
v.end();
462 for (std::vector<std::string>::const_iterator
i =
destinations.begin();
i !=
end; ++
i) {
464 destinationPSet(
d, *
i);
472 categoryPSets(
pset, psetName);
476 noNoncategoryPsets(
pset, psetName);
480 check<bool>(
pset, psetName,
"placeholder");
483 validateThreshold(
thresh, psetName);
484 check<bool>(
pset, psetName,
"noLineBreaks");
485 check<int>(
pset, psetName,
"lineLength");
486 check<bool>(
pset, psetName,
"noTimeStamps");
488 if ((
s ==
"cerr") || (
s ==
"cout")) {
489 flaws << psetName <<
" PSet: \n" <<
s <<
" is not allowed as a value of filename \n";
491 s = check<std::string>(
pset,
"psetName",
"extension");
492 if ((
s ==
"cerr") || (
s ==
"cout")) {
493 flaws << psetName <<
" PSet: \n" <<
s <<
" is not allowed as a value of extension \n";
495 s = check<std::string>(
pset,
"psetName",
"output");
499 noneExcept<int>(
pset, psetName,
"int",
"lineLength");
502 okbool.push_back(
"placeholder");
503 okbool.push_back(
"optionalPSet");
504 okbool.push_back(
"noLineBreaks");
505 okbool.push_back(
"noTimeStamps");
506 noneExcept<bool>(
pset, psetName,
"bool", okbool);
508 okstring.push_back(
"threshold");
509 okstring.push_back(
"output");
510 okstring.push_back(
"filename");
511 okstring.push_back(
"extension");
512 noneExcept<std::string>(
pset, psetName,
"string", okstring);
519 std::string psetName =
"default (at MessageLogger main level)";
523 categoryPSets(
pset, psetName);
527 noNoncategoryPsets(
pset, psetName);
531 catInts(
pset, psetName,
"default");
535 check<bool>(
pset, psetName,
"placeholder");
538 validateThreshold(
thresh, psetName);
539 check<bool>(
pset, psetName,
"noLineBreaks");
540 check<int>(
pset, psetName,
"limit");
541 check<int>(
pset, psetName,
"reportEvery");
542 check<int>(
pset, psetName,
"timespan");
543 check<int>(
pset, psetName,
"lineLength");
544 check<bool>(
pset, psetName,
"noTimeStamps");
548 okint.push_back(
"limit");
549 okint.push_back(
"reportEvery");
550 okint.push_back(
"timespan");
551 okint.push_back(
"lineLength");
552 noneExcept<int>(
pset, psetName,
"int", okint);
554 okbool.push_back(
"placeholder");
555 okbool.push_back(
"optionalPSet");
556 okbool.push_back(
"noLineBreaks");
557 okbool.push_back(
"noTimeStamps");
558 noneExcept<bool>(
pset, psetName,
"bool", okbool);
560 okstring.push_back(
"threshold");
561 noneExcept<std::string>(
pset, psetName,
"string", okstring);
567 std::vector<std::string>::const_iterator
end =
statistics.end();
568 for (std::vector<std::string>::const_iterator
i =
statistics.begin();
i !=
end; ++
i) {
572 statisticsPSet(
d, *
i);
580 categoryPSets(
pset, psetName);
584 noNoncategoryPsets(
pset, psetName);
590 validateThreshold(
thresh, psetName);
591 check<bool>(
pset, psetName,
"placeholder");
592 check<bool>(
pset, psetName,
"reset");
594 if ((
s ==
"cerr") || (
s ==
"cout")) {
595 flaws << psetName <<
" PSet: \n" <<
s <<
" is not allowed as a value of filename \n";
597 s = check<std::string>(
pset,
"psetName",
"extension");
598 if ((
s ==
"cerr") || (
s ==
"cout")) {
599 flaws << psetName <<
" PSet: \n" <<
s <<
" is not allowed as a value of extension \n";
601 s = check<std::string>(
pset,
"psetName",
"output");
605 noneExcept<int>(
pset, psetName,
"int");
608 okbool.push_back(
"placeholder");
609 okbool.push_back(
"optionalPSet");
610 okbool.push_back(
"reset");
611 noneExcept<bool>(
pset, psetName,
"bool", okbool);
613 okstring.push_back(
"output");
614 okstring.push_back(
"filename");
615 okstring.push_back(
"extension");
616 okstring.push_back(
"threshold");
617 noneExcept<std::string>(
pset, psetName,
"string", okstring);
626 fwkJobReportPSet(
d, *
i);
634 categoryPSets(
pset, psetName);
638 noNoncategoryPsets(
pset, psetName);
642 check<bool>(
pset, psetName,
"placeholder");
644 if ((
s ==
"cerr") || (
s ==
"cout")) {
645 flaws << psetName <<
" PSet: \n" <<
s <<
" is not allowed as a value of filename \n";
647 s = check<std::string>(
pset,
"psetName",
"extension");
648 if ((
s ==
"cerr") || (
s ==
"cout")) {
649 flaws << psetName <<
" PSet: \n" <<
s <<
" is not allowed as a value of extension \n";
651 s = check<std::string>(
pset,
"psetName",
"output");
655 noneExcept<int>(
pset, psetName,
"int");
658 okbool.push_back(
"placeholder");
659 okbool.push_back(
"optionalPSet");
660 noneExcept<bool>(
pset, psetName,
"bool", okbool);
662 okstring.push_back(
"output");
663 okstring.push_back(
"filename");
664 okstring.push_back(
"extension");
665 noneExcept<std::string>(
pset, psetName,
"string", okstring);
672 pset.getParameterSetNames(psnames,
false);
673 vString::const_iterator
end = psnames.end();
674 for (vString::const_iterator
i = psnames.begin();
i !=
end; ++
i) {
677 if (lookForMatch(messageIDs, *
i))
679 if ((*
i) ==
"default")
683 if ((*
i) ==
"WARNING")
690 bool ok_optionalPSet =
false;
699 flaws << psetName <<
" PSet: \n" << *
i <<
" is an unrecognized name for a PSet in this context \n";
702 unsigned int n =
pset.getParameterSetNames(psnames,
true);
705 for (vString::const_iterator
i = psnames.begin();
i !=
end; ++
i) {
706 flaws << psetName <<
" PSet: \n"
707 <<
"PSet " << *
i <<
" is tracked - not allowed\n";
714 categoryPSet(
pset, psetName,
"ERROR");
715 categoryPSet(
pset, psetName,
"WARNING");
716 categoryPSet(
pset, psetName,
"INFO");
717 categoryPSet(
pset, psetName,
"DEBUG");
718 if (psetName !=
"MessageLogger")
719 categoryPSet(
pset, psetName,
"default");
722 std::vector<std::string>::const_iterator
end =
categories.end();
723 for (std::vector<std::string>::const_iterator
i =
categories.begin();
i !=
end; ++
i) {
724 categoryPSet(
pset, psetName, *
i);
732 flaws << OuterPsetName <<
" PSet: \n"
733 <<
"Category PSet " << categoryName <<
" is tracked - not allowed\n";
739 catInts(
c, psetName, categoryName);
740 catNone<unsigned int>(
c, psetName, categoryName,
"unsigned int");
741 catBoolRestriction(
c, psetName, categoryName,
"bool");
742 catNone<float>(
c, psetName, categoryName,
"float");
743 catNone<double>(
c, psetName, categoryName,
"double");
744 catNone<std::string>(
c, psetName, categoryName,
"string");
745 catNone<vString>(
c, psetName, categoryName,
"vSting");
746 catNoPSets(
c, psetName, categoryName);
752 vString x =
pset.getParameterNamesForType<
int>(
false);
753 vString::const_iterator
end = x.end();
754 for (vString::const_iterator
i = x.begin();
i !=
end; ++
i) {
757 if (*
i ==
"reportEvery")
759 if (*
i ==
"timespan")
761 flaws << categoryName <<
" category PSet nested in " << psetName <<
" PSet: \n"
762 << (*i) <<
" is not an allowed parameter within a category PSet \n";
764 x =
pset.getParameterNamesForType<
int>(
true);
766 for (vString::const_iterator
i = x.begin();
i !=
end; ++
i) {
767 flaws << categoryName <<
" category PSet nested in " << psetName <<
" PSet: \n"
768 << (*i) <<
" is used as a tracked int \n"
769 <<
"Tracked parameters not allowed here \n";
777 pset.getParameterSetNames(psnames,
false);
778 vString::const_iterator
end = psnames.end();
779 for (vString::const_iterator
i = psnames.begin();
i !=
end; ++
i) {
780 flaws << categoryName <<
" category PSet nested in " << psetName <<
" PSet: \n"
781 << *
i <<
" is used as a PSet\n"
782 <<
"PSets not allowed within a category PSet\n";
785 unsigned int n =
pset.getParameterSetNames(psnames,
true);
788 for (vString::const_iterator
i = psnames.begin();
i !=
end; ++
i) {
789 flaws << categoryName <<
" category PSet nested in " << psetName <<
" PSet: \n"
790 << *
i <<
" is used as a tracked PSet\n"
791 <<
"tracked parameters not permitted, and "
792 <<
"PSets not allowed within a category PSet\n";
801 vString x =
pset.getParameterNamesForType<
bool>(
false);
802 vString::const_iterator
end = x.end();
803 for (vString::const_iterator
i = x.begin();
i !=
end; ++
i) {
804 if (((*
i) ==
"placeholder") || ((*i) ==
"optionalPSet"))
806 flaws << categoryName <<
" category PSet nested in " << psetName <<
" PSet: \n"
807 << (*i) <<
" is used as a " <<
type <<
"\n"
808 <<
"Usage of " <<
type <<
" is not recognized here\n";
810 x =
pset.getParameterNamesForType<
bool>(
true);
812 for (vString::const_iterator
i = x.begin();
i !=
end; ++
i) {
813 flaws << categoryName <<
" category PSet nested in " << psetName <<
" PSet: \n"
814 << (*i) <<
" is used as a tracked " <<
type <<
"\n"
815 <<
"Tracked parameters not allowed here, "
816 <<
" and even untracked it would not be recognized\n";