CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes
edm::service::MessageLoggerDefaults Struct Reference

#include <MessageLoggerDefaults.h>

Classes

struct  Category
 
struct  Destination
 

Public Member Functions

void hardwireAnalysisJobMode ()
 
void hardwireGridJobMode ()
 
void hardwireNilJobMode ()
 
void hardwireReleaseValidationJobMode ()
 
int limit (std::string const &dest, std::string const &cat) const
 
 MessageLoggerDefaults (edm::JobMode mode=GridJobMode)
 
std::string output (std::string const &dest) const
 
int reportEvery (std::string const &dest, std::string const &cat) const
 
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
 
std::string threshold (std::string const &dest) const
 
int timespan (std::string const &dest, std::string const &cat) const
 

Static Public Member Functions

static edm::JobMode mode (std::string const &jm)
 

Public Attributes

std::vector< std::string > categories
 
std::map< std::string, Destinationdestination
 
std::vector< std::string > destinations
 
std::vector< std::string > statistics
 

Static Public Attributes

static const int NO_VALUE_SET = -45654
 

Detailed Description

Definition at line 69 of file MessageLoggerDefaults.h.

Constructor & Destructor Documentation

◆ MessageLoggerDefaults()

edm::service::MessageLoggerDefaults::MessageLoggerDefaults ( edm::JobMode  mode = GridJobMode)
inlineexplicit

Definition at line 119 of file MessageLoggerDefaults.h.

References edm::AnalysisJobMode, cms::cuda::assert(), edm::GridJobMode, hardwireAnalysisJobMode(), hardwireGridJobMode(), hardwireNilJobMode(), hardwireReleaseValidationJobMode(), mode(), edm::NilJobMode, and edm::ReleaseValidationJobMode.

119  {
120  // mode-independent defaults
121 
122  // mode-dependent defaults
123  switch (mode) {
124  // GridJobMode: Intended for automated batch-like processing, in which
125  // the output stream for cerr is routed to an apropro
126  // file. LogInfo messages are enabled, and at least
127  // one such message is delivered from the framework per
128  // event, so this mode is not suitable for many-Hz light
129  // event processing.
130  case GridJobMode:
132  break;
135  break;
136  case AnalysisJobMode:
138  break;
139  case NilJobMode:
141  break;
142  default:
143  // this should never happen! No user error can get here.
144  bool Invalid_JobMode_in_ctor_of_MessageLoggerDefaults = false;
145  assert(Invalid_JobMode_in_ctor_of_MessageLoggerDefaults);
146  } // end of switch on mode
147  }
assert(be >=bs)
static edm::JobMode mode(std::string const &jm)

Member Function Documentation

◆ hardwireAnalysisJobMode()

void MessageLoggerDefaults::hardwireAnalysisJobMode ( )

Definition at line 127 of file HardwiredDefaults.cc.

References categories, DMR_cfg::cerr, destination, destinations, MessageLogger_cff::FwkReport, MessageLogger_ReleaseValidation_cfi::FwkSummary, edm::service::MessageLoggerDefaults::Category::limit, MessageLogger_ReleaseValidation_cfi::Root_NoDictionary, statistics, and GCP_Ntuples_cfg::warnings.

Referenced by MessageLoggerDefaults().

127  {
128  // std::cerr << " ======= hardwireAnalysisJobMode() \n";
129  destinations.push_back("warnings");
130  categories.push_back("FwkReport");
131  categories.push_back("FwkSummary");
132  categories.push_back("Root_NoDictionary");
133  statistics.push_back("cerr");
134  // cerr destination -
135  // note that using the name cerr is OK since it is not std::cerr
136  // but when we want to use default as a name, we have to be circumspect
137  {
138  Destination warnings; // PSet warnings
139  warnings.threshold = "INFO"; // string threshold = "INFO"
140  Category INFO_limits; // PSet INFO = { ... }
141  INFO_limits.limit = 0; // int32 limit = 0
142  warnings.sev["INFO"] = INFO_limits;
143  Category default_for_dest; // PSet default
144  default_for_dest.limit = 1000; // int32 limit = 1000
145  warnings.category["default"] = default_for_dest;
146  Category FwkReport; // PSet FwkReport
147  FwkReport.limit = 10000000; // int32 limit = 10000000
148  FwkReport.reportEvery = 100; // int32 reportEvery = 100
149  warnings.category["FwkReport"] = FwkReport;
150  Category FwkSummary; // PSet FwkSummary
151  FwkSummary.limit = 10000000; // int32 limit = 10000000
152  warnings.category["FwkSummary"] = FwkSummary;
153  Category Root_NoDictionary; // PSet Root_NoDictionary
154  Root_NoDictionary.limit = 0; // int32 limit = 0
155  warnings.category["Root_NoDictionary"] = Root_NoDictionary;
156  destination["warnings"] = warnings;
157  }
158  {
159  Destination cerr; // PSet cerr
160  cerr.threshold = "INFO"; // string threshold = "INFO"
161  destination["cerr"] = cerr;
162  }
163  } // hardwireAnalysisJobMode
std::map< std::string, Destination > destination
std::vector< std::string > statistics
std::vector< std::string > destinations
std::vector< std::string > categories

◆ hardwireGridJobMode()

void MessageLoggerDefaults::hardwireGridJobMode ( )

Definition at line 45 of file HardwiredDefaults.cc.

References categories, DMR_cfg::cerr, MessageLogger_cfi::cerr_stats, destination, destinations, MessageLogger_cff::FwkReport, MessageLogger_ReleaseValidation_cfi::FwkSummary, edm::service::MessageLoggerDefaults::Category::limit, MessageLogger_ReleaseValidation_cfi::Root_NoDictionary, and statistics.

Referenced by MessageLoggerDefaults().

45  {
46  // std::cerr << " ======= hardwireGridJobMode() \n";
47  destinations.push_back("cerr");
48  categories.push_back("FwkReport");
49  categories.push_back("FwkSummary");
50  categories.push_back("Root_NoDictionary");
51  statistics.push_back("cerr_stats");
52  // cerr destination -
53  // note that using the name cerr is OK since it is not std::cerr
54  // but when we want to use default as a name, we have to be circumspect
55  {
56  Destination cerr; // PSet cerr
57  cerr.threshold = "INFO"; // string threshold = "INFO"
58  Category INFO_limits; // PSet INFO = { ... }
59  INFO_limits.limit = 0; // int32 limit = 0
60  cerr.sev["INFO"] = INFO_limits;
61  Category default_for_dest; // PSet default
62  default_for_dest.limit = 10000000; // int32 limit = 10000000
63  cerr.category["default"] = default_for_dest;
64  Category FwkReport; // PSet FwkReport
65  FwkReport.limit = 10000000; // int32 limit = 10000000
66  FwkReport.reportEvery = 1; // int32 reportEvery = 1
67  cerr.category["FwkReport"] = FwkReport;
68  Category FwkSummary; // PSet FwkSummary
69  FwkSummary.limit = 10000000; // int32 limit = 10000000
70  FwkSummary.reportEvery = 1; // int32 reportEvery = 1
71  cerr.category["FwkSummary"] = FwkSummary;
72  Category Root_NoDictionary; // PSet Root_NoDictionary
73  Root_NoDictionary.limit = 0; // int32 limit = 0
74  cerr.category["Root_NoDictionary"] = Root_NoDictionary;
75  destination["cerr"] = cerr;
76  }
77  {
78  Destination cerr_stats; // PSet cerr_stats
79  cerr_stats.threshold = "WARNING"; // string threshold = "WARNING"
80  cerr_stats.output = "cerr"; // string output = "cerr"
81  destination["cerr_stats"] = cerr_stats;
82  }
83 
84  } // hardwireGridJobMode
std::map< std::string, Destination > destination
std::vector< std::string > statistics
std::vector< std::string > destinations
std::vector< std::string > categories

◆ hardwireNilJobMode()

void MessageLoggerDefaults::hardwireNilJobMode ( )

Definition at line 165 of file HardwiredDefaults.cc.

Referenced by MessageLoggerDefaults().

165  {
166  // std::cerr << " ======= hardwireNilJobMode() \n";
167  } // hardwireNilJobMode

◆ hardwireReleaseValidationJobMode()

void MessageLoggerDefaults::hardwireReleaseValidationJobMode ( )

Definition at line 86 of file HardwiredDefaults.cc.

References categories, DMR_cfg::cerr, MessageLogger_cfi::cerr_stats, destination, destinations, MessageLogger_cff::FwkReport, MessageLogger_ReleaseValidation_cfi::FwkSummary, edm::service::MessageLoggerDefaults::Category::limit, MessageLogger_ReleaseValidation_cfi::Root_NoDictionary, and statistics.

Referenced by MessageLoggerDefaults().

86  {
87  // std::cerr << " ======= hardwireReleaseValidationJobMode() \n";
88  destinations.push_back("cerr");
89  categories.push_back("FwkReport");
90  categories.push_back("FwkSummary");
91  categories.push_back("Root_NoDictionary");
92  statistics.push_back("cerr_stats");
93  // cerr destination -
94  // note that using the name cerr is OK since it is not std::cerr
95  // but when we want to use default as a name, we have to be circumspect
96  {
97  Destination cerr; // PSet cerr
98  cerr.threshold = "INFO"; // string threshold = "INFO"
99  Category INFO_limits; // PSet INFO = { ... }
100  INFO_limits.limit = 5; // int32 limit = 5
101  cerr.sev["INFO"] = INFO_limits;
102  Category default_for_dest; // PSet default
103  default_for_dest.limit = 10000000; // int32 limit = 10000000
104  cerr.category["default"] = default_for_dest;
105  Category FwkReport; // PSet FwkReport
106  FwkReport.limit = 10000000; // int32 limit = 10000000
107  FwkReport.reportEvery = 1; // int32 reportEvery = 1
108  cerr.category["FwkReport"] = FwkReport;
109  Category FwkSummary; // PSet FwkSummary
110  FwkSummary.limit = 10000000; // int32 limit = 10000000
111  FwkSummary.reportEvery = 1; // int32 reportEvery = 1
112  cerr.category["FwkSummary"] = FwkSummary;
113  Category Root_NoDictionary; // PSet Root_NoDictionary
114  Root_NoDictionary.limit = 0; // int32 limit = 0
115  cerr.category["Root_NoDictionary"] = Root_NoDictionary;
116  destination["cerr"] = cerr;
117  }
118  {
119  Destination cerr_stats; // PSet cerr_stats
120  cerr_stats.threshold = "INFO"; // string threshold = "INFO"
121  cerr_stats.output = "cerr"; // string output = "cerr"
122  destination["cerr_stats"] = cerr_stats;
123  }
124 
125  } // hardwireReleaseValidationJobMode
std::map< std::string, Destination > destination
std::vector< std::string > statistics
std::vector< std::string > destinations
std::vector< std::string > categories

◆ limit()

int MessageLoggerDefaults::limit ( std::string const &  dest,
std::string const &  cat 
) const

Definition at line 52 of file MessageLoggerDefaults.cc.

References c, eostools::cat(), hippyaddtobaddatafiles::cd(), ztail::d, createTree::dd, mps_fire::dest, destination, and NO_VALUE_SET.

52  {
53  int lim = NO_VALUE_SET;
54  auto d = destination.find(dest);
55  if (d != destination.end()) {
56  auto const& destin = d->second;
57  auto c = destin.category.find(cat);
58  if (c != destin.category.end()) {
59  lim = c->second.limit;
60  }
61  }
62  auto dd = destination.find("default");
63  if (lim == NO_VALUE_SET) {
64  if (dd != destination.end()) {
65  auto const& def_destin = dd->second;
66  auto c = def_destin.category.find(cat);
67  if (c != def_destin.category.end()) {
68  lim = c->second.limit;
69  }
70  }
71  }
72  if (lim == NO_VALUE_SET) {
73  if (d != destination.end()) {
74  auto const& destin = d->second;
75  auto cd = destin.category.find("default");
76  if (cd != destin.category.end()) {
77  lim = cd->second.limit;
78  }
79  }
80  }
81  if (lim == NO_VALUE_SET) {
82  if (dd != destination.end()) {
83  auto const& def_destin = dd->second;
84  auto cdd = def_destin.category.find("default");
85  if (cdd != def_destin.category.end()) {
86  lim = cdd->second.limit;
87  }
88  }
89  }
90  return lim;
91  } // limit
std::map< std::string, Destination > destination
string dd
Definition: createTree.py:154
def cat(path)
Definition: eostools.py:401
d
Definition: ztail.py:151

◆ mode()

edm::JobMode MessageLoggerDefaults::mode ( std::string const &  jm)
static

Definition at line 30 of file HardwiredDefaults.cc.

References edm::AnalysisJobMode, DMR_cfg::cerr, edm::GridJobMode, edm::NilJobMode, and edm::ReleaseValidationJobMode.

Referenced by MessageLoggerDefaults(), and edm::service::ThreadSafeLogMessageLoggerScribe::runCommand().

30  {
31  if (jm.empty())
32  return GridJobMode; // no -mode option = grid
33  if (jm == "grid")
34  return GridJobMode;
35  if (jm == "infos")
37  if (jm == "analysis")
38  return AnalysisJobMode;
39  if (jm == "nil")
40  return NilJobMode;
41  std::cerr << "Unrecognized Job Mode Option: " << jm << " -- defaulting to analysis mode ";
42  return AnalysisJobMode;
43  }

◆ output()

std::string MessageLoggerDefaults::output ( std::string const &  dest) const

Definition at line 41 of file MessageLoggerDefaults.cc.

References ztail::d, mps_fire::dest, destination, and AlCaHLTBitMon_QueryRunRegistry::string.

41  {
42  std::string otpt = "";
43  auto d = destination.find(dest);
44  if (d != destination.end()) {
45  auto const& destin = d->second;
46  otpt = destin.output;
47  }
48  // There is no default output; so if we did not find the dest, then return ""
49  return otpt;
50  } // output
std::map< std::string, Destination > destination
d
Definition: ztail.py:151

◆ reportEvery()

int MessageLoggerDefaults::reportEvery ( std::string const &  dest,
std::string const &  cat 
) const

Definition at line 93 of file MessageLoggerDefaults.cc.

References c, eostools::cat(), hippyaddtobaddatafiles::cd(), ztail::d, createTree::dd, mps_fire::dest, destination, and NO_VALUE_SET.

93  {
94  int re = NO_VALUE_SET;
95  auto d = destination.find(dest);
96  if (d != destination.end()) {
97  auto const& destin = d->second;
98  auto c = destin.category.find(cat);
99  if (c != destin.category.end()) {
100  re = c->second.reportEvery;
101  }
102  }
103  auto dd = destination.find("default");
104  if (re == NO_VALUE_SET) {
105  if (dd != destination.end()) {
106  auto const& def_destin = dd->second;
107  auto c = def_destin.category.find(cat);
108  if (c != def_destin.category.end()) {
109  re = c->second.reportEvery;
110  }
111  }
112  }
113  if (re == NO_VALUE_SET) {
114  if (d != destination.end()) {
115  auto const& destin = d->second;
116  auto cd = destin.category.find("default");
117  if (cd != destin.category.end()) {
118  re = cd->second.reportEvery;
119  }
120  }
121  }
122  if (re == NO_VALUE_SET) {
123  if (dd != destination.end()) {
124  auto const& def_destin = dd->second;
125  auto cdd = def_destin.category.find("default");
126  if (cdd != def_destin.category.end()) {
127  re = cdd->second.reportEvery;
128  }
129  }
130  }
131  return re;
132  } // reportEvery
std::map< std::string, Destination > destination
string dd
Definition: createTree.py:154
def cat(path)
Definition: eostools.py:401
d
Definition: ztail.py:151

◆ sev_limit()

int MessageLoggerDefaults::sev_limit ( std::string const &  dest,
std::string const &  sev 
) const

Definition at line 175 of file MessageLoggerDefaults.cc.

References c, eostools::cat(), hippyaddtobaddatafiles::cd(), ztail::d, createTree::dd, mps_fire::dest, destination, and NO_VALUE_SET.

175  {
176  int lim = NO_VALUE_SET;
177  auto d = destination.find(dest);
178  if (d != destination.end()) {
179  auto const& destin = d->second;
180  auto c = destin.sev.find(cat);
181  if (c != destin.sev.end()) {
182  lim = c->second.limit;
183  }
184  }
185  auto dd = destination.find("default");
186  if (lim == NO_VALUE_SET) {
187  if (dd != destination.end()) {
188  auto const& def_destin = dd->second;
189  auto c = def_destin.sev.find(cat);
190  if (c != def_destin.sev.end()) {
191  lim = c->second.limit;
192  }
193  }
194  }
195  if (lim == NO_VALUE_SET) {
196  if (d != destination.end()) {
197  auto const& destin = d->second;
198  auto cd = destin.sev.find("default");
199  if (cd != destin.sev.end()) {
200  lim = cd->second.limit;
201  }
202  }
203  }
204  if (lim == NO_VALUE_SET) {
205  if (dd != destination.end()) {
206  auto const& def_destin = dd->second;
207  auto cdd = def_destin.sev.find("default");
208  if (cdd != def_destin.sev.end()) {
209  lim = cdd->second.limit;
210  }
211  }
212  }
213  return lim;
214  } // sev_limit
std::map< std::string, Destination > destination
string dd
Definition: createTree.py:154
def cat(path)
Definition: eostools.py:401
d
Definition: ztail.py:151

◆ sev_reportEvery()

int MessageLoggerDefaults::sev_reportEvery ( std::string const &  dest,
std::string const &  sev 
) const

Definition at line 216 of file MessageLoggerDefaults.cc.

References c, eostools::cat(), hippyaddtobaddatafiles::cd(), ztail::d, createTree::dd, mps_fire::dest, destination, and NO_VALUE_SET.

216  {
217  int re = NO_VALUE_SET;
218  auto d = destination.find(dest);
219  if (d != destination.end()) {
220  auto const& destin = d->second;
221  auto c = destin.sev.find(cat);
222  if (c != destin.sev.end()) {
223  re = c->second.reportEvery;
224  }
225  }
226  auto dd = destination.find("default");
227  if (re == NO_VALUE_SET) {
228  if (dd != destination.end()) {
229  auto const& def_destin = dd->second;
230  auto c = def_destin.sev.find(cat);
231  if (c != def_destin.sev.end()) {
232  re = c->second.reportEvery;
233  }
234  }
235  }
236  if (re == NO_VALUE_SET) {
237  if (d != destination.end()) {
238  auto const& destin = d->second;
239  auto cd = destin.sev.find("default");
240  if (cd != destin.sev.end()) {
241  re = cd->second.reportEvery;
242  }
243  }
244  }
245  if (re == NO_VALUE_SET) {
246  if (dd != destination.end()) {
247  auto const& def_destin = dd->second;
248  auto cdd = def_destin.sev.find("default");
249  if (cdd != def_destin.sev.end()) {
250  re = cdd->second.reportEvery;
251  }
252  }
253  }
254  return re;
255  } // sev_reportEvery
std::map< std::string, Destination > destination
string dd
Definition: createTree.py:154
def cat(path)
Definition: eostools.py:401
d
Definition: ztail.py:151

◆ sev_timespan()

int MessageLoggerDefaults::sev_timespan ( std::string const &  dest,
std::string const &  sev 
) const

Definition at line 257 of file MessageLoggerDefaults.cc.

References c, eostools::cat(), hippyaddtobaddatafiles::cd(), ztail::d, createTree::dd, mps_fire::dest, destination, and NO_VALUE_SET.

257  {
258  int tim = NO_VALUE_SET;
259  auto d = destination.find(dest);
260  if (d != destination.end()) {
261  auto const& destin = d->second;
262  auto c = destin.sev.find(cat);
263  if (c != destin.sev.end()) {
264  tim = c->second.timespan;
265  }
266  }
267  auto dd = destination.find("default");
268  if (tim == NO_VALUE_SET) {
269  if (dd != destination.end()) {
270  auto const& def_destin = dd->second;
271  auto c = def_destin.sev.find(cat);
272  if (c != def_destin.sev.end()) {
273  tim = c->second.timespan;
274  }
275  }
276  }
277  if (tim == NO_VALUE_SET) {
278  if (d != destination.end()) {
279  auto const& destin = d->second;
280  auto cd = destin.sev.find("default");
281  if (cd != destin.sev.end()) {
282  tim = cd->second.timespan;
283  }
284  }
285  }
286  if (tim == NO_VALUE_SET) {
287  if (dd != destination.end()) {
288  auto const& def_destin = dd->second;
289  auto cdd = def_destin.sev.find("default");
290  if (cdd != def_destin.sev.end()) {
291  tim = cdd->second.timespan;
292  }
293  }
294  }
295  return tim;
296  } // sev_timespan
std::map< std::string, Destination > destination
string dd
Definition: createTree.py:154
def cat(path)
Definition: eostools.py:401
d
Definition: ztail.py:151

◆ threshold()

std::string MessageLoggerDefaults::threshold ( std::string const &  dest) const

Definition at line 24 of file MessageLoggerDefaults.cc.

References ztail::d, createTree::dd, mps_fire::dest, destination, and AlCaHLTBitMon_QueryRunRegistry::string.

24  {
25  std::string thr = "";
26  auto d = destination.find(dest);
27  if (d != destination.end()) {
28  auto const& destin = d->second;
29  thr = destin.threshold;
30  }
31  auto dd = destination.find("default");
32  if (thr.empty()) {
33  if (dd != destination.end()) {
34  auto const& def_destin = dd->second;
35  thr = def_destin.threshold;
36  }
37  }
38  return thr;
39  } // threshold
std::map< std::string, Destination > destination
string dd
Definition: createTree.py:154
d
Definition: ztail.py:151

◆ timespan()

int MessageLoggerDefaults::timespan ( std::string const &  dest,
std::string const &  cat 
) const

Definition at line 134 of file MessageLoggerDefaults.cc.

References c, eostools::cat(), hippyaddtobaddatafiles::cd(), ztail::d, createTree::dd, mps_fire::dest, destination, and NO_VALUE_SET.

134  {
135  int tim = NO_VALUE_SET;
136  auto d = destination.find(dest);
137  if (d != destination.end()) {
138  auto const& destin = d->second;
139  auto c = destin.category.find(cat);
140  if (c != destin.category.end()) {
141  tim = c->second.timespan;
142  }
143  }
144  auto dd = destination.find("default");
145  if (tim == NO_VALUE_SET) {
146  if (dd != destination.end()) {
147  auto const& def_destin = dd->second;
148  auto c = def_destin.category.find(cat);
149  if (c != def_destin.category.end()) {
150  tim = c->second.timespan;
151  }
152  }
153  }
154  if (tim == NO_VALUE_SET) {
155  if (d != destination.end()) {
156  auto const& destin = d->second;
157  auto cd = destin.category.find("default");
158  if (cd != destin.category.end()) {
159  tim = cd->second.timespan;
160  }
161  }
162  }
163  if (tim == NO_VALUE_SET) {
164  if (dd != destination.end()) {
165  auto const& def_destin = dd->second;
166  auto cdd = def_destin.category.find("default");
167  if (cdd != def_destin.category.end()) {
168  tim = cdd->second.timespan;
169  }
170  }
171  }
172  return tim;
173  } // timespan
std::map< std::string, Destination > destination
string dd
Definition: createTree.py:154
def cat(path)
Definition: eostools.py:401
d
Definition: ztail.py:151

Member Data Documentation

◆ categories

std::vector<std::string> edm::service::MessageLoggerDefaults::categories

◆ destination

std::map<std::string, Destination> edm::service::MessageLoggerDefaults::destination

◆ destinations

std::vector<std::string> edm::service::MessageLoggerDefaults::destinations

◆ NO_VALUE_SET

const int edm::service::MessageLoggerDefaults::NO_VALUE_SET = -45654
static

◆ statistics

std::vector<std::string> edm::service::MessageLoggerDefaults::statistics