File indexing completed on 2024-04-06 12:12:46
0001 #ifndef MessageLogger_MessageLoggerDefaults_h
0002 #define MessageLogger_MessageLoggerDefaults_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 #include "FWCore/Utilities/interface/JobMode.h"
0032
0033
0034
0035 #include <string>
0036 #include <vector>
0037 #include <map>
0038 #include <cassert>
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066 namespace edm {
0067 namespace service {
0068
0069 struct MessageLoggerDefaults {
0070 public:
0071 static const int NO_VALUE_SET = -45654;
0072
0073 struct Category {
0074 std::string threshold;
0075 int limit;
0076 int reportEvery;
0077 int timespan;
0078 Category() : threshold(""), limit(NO_VALUE_SET), reportEvery(NO_VALUE_SET), timespan(NO_VALUE_SET) {}
0079 };
0080
0081 struct Destination {
0082 std::string threshold;
0083 std::map<std::string, Category> category;
0084 std::map<std::string, Category> sev;
0085 std::string output;
0086 };
0087
0088
0089
0090 std::vector<std::string> categories;
0091 std::vector<std::string> destinations;
0092 std::vector<std::string> statistics;
0093 std::map<std::string, Destination> destination;
0094
0095
0096
0097 std::string threshold(std::string const& dest) const;
0098 std::string output(std::string const& dest) const;
0099
0100 int limit(std::string const& dest, std::string const& cat) const;
0101 int reportEvery(std::string const& dest, std::string const& cat) const;
0102 int timespan(std::string const& dest, std::string const& cat) const;
0103
0104 int sev_limit(std::string const& dest, std::string const& sev) const;
0105 int sev_reportEvery(std::string const& dest, std::string const& sev) const;
0106 int sev_timespan(std::string const& dest, std::string const& sev) const;
0107
0108
0109
0110 void hardwireGridJobMode();
0111 void hardwireReleaseValidationJobMode();
0112 void hardwireAnalysisJobMode();
0113 void hardwireNilJobMode();
0114
0115 static edm::JobMode mode(std::string const& jm);
0116
0117
0118
0119 explicit MessageLoggerDefaults(edm::JobMode mode = GridJobMode) {
0120
0121
0122
0123 switch (mode) {
0124
0125
0126
0127
0128
0129
0130 case GridJobMode:
0131 hardwireGridJobMode();
0132 break;
0133 case ReleaseValidationJobMode:
0134 hardwireReleaseValidationJobMode();
0135 break;
0136 case AnalysisJobMode:
0137 hardwireAnalysisJobMode();
0138 break;
0139 case NilJobMode:
0140 hardwireNilJobMode();
0141 break;
0142 default:
0143
0144 bool Invalid_JobMode_in_ctor_of_MessageLoggerDefaults = false;
0145 assert(Invalid_JobMode_in_ctor_of_MessageLoggerDefaults);
0146 }
0147 }
0148 };
0149
0150 }
0151 }
0152
0153 #endif