CMS 3D CMS Logo

MessageLoggerDefaults.h
Go to the documentation of this file.
1 #ifndef MessageLogger_MessageLoggerDefaults_h
2 #define MessageLogger_MessageLoggerDefaults_h
3 
4 // -*- C++ -*-
5 //
6 // Package: MessageLogger
7 // Class : MessageLoggerDefaults
8 //
24 //
25 // Original Author: M. Fischler
26 // Created: Tues Jun 14 10:38:19 CST 2007
27 //
28 
29 // Framework include files
30 
32 
33 // system include files
34 
35 #include <string>
36 #include <vector>
37 #include <map>
38 #include <cassert>
39 
40 // Change log
41 //
42 // 6/15/07 mf Original version
43 //
44 // -------------------------------------------------------
45 
46 // user include files
47 
48 // ----------------
49 // Maintenance Tips
50 // ----------------
51 //
52 // When default values change for one job mode of operation or another,
53 // implement that change in the appropriate member function implemented
54 // in HardwiredDefaults.cc. For example, hardwireGridJobMode().
55 //
56 // When a new default is needed, add the item to the struct, and then place
57 // the default value into the appropriate sections of the various member
58 // functions in HardwiredDefaults.cc.
59 // It may be necessary to supply values of that default for each of the modes,
60 // even though the ErrorLogger default is suitable for all the modes but one.
61 //
62 // When the new default is of a type not already being accessed, also add
63 // the accessor method in this header, and implement it in
64 // MessageLoggerDefaults.cc following the pattern shown for existing items
65 
66 namespace edm {
67  namespace service {
68 
70  public:
71  static const int NO_VALUE_SET = -45654;
72 
73  struct Category {
75  int limit;
77  int timespan;
79  };
80 
81  struct Destination {
83  std::map<std::string, Category> category;
84  std::map<std::string, Category> sev;
86  };
87 
88  // publicly available collections and structures
89 
90  std::vector<std::string> categories;
91  std::vector<std::string> destinations;
92  std::vector<std::string> fwkJobReports;
93  std::vector<std::string> statistics;
94  std::map<std::string, Destination> destination;
95 
96  // access to values set
97 
100 
101  int limit(std::string const& dest, std::string const& cat);
102  int reportEvery(std::string const& dest, std::string const& cat);
103  int timespan(std::string const& dest, std::string const& cat);
104 
105  int sev_limit(std::string const& dest, std::string const& sev);
106  int sev_reportEvery(std::string const& dest, std::string const& sev);
107  int sev_timespan(std::string const& dest, std::string const& sev);
108 
109  // Modes with hardwired defaults
110 
111  void hardwireGridJobMode();
114  void hardwireNilJobMode();
115 
116  static edm::JobMode mode(std::string const& jm);
117 
118  // ctor
119 
121  // mode-independent defaults
122 
123  // mode-dependent defaults
124  switch (mode) {
125  // GridJobMode: Intended for automated batch-like processing, in which
126  // the output stream for cerr is routed to an apropro
127  // file. LogInfo messages are enabled, and at least
128  // one such message is delivered from the framework per
129  // event, so this mode is not suitable for many-Hz light
130  // event processing.
131  case GridJobMode:
133  break;
136  break;
137  case AnalysisJobMode:
139  break;
140  case NilJobMode:
142  break;
143  default:
144  // this should never happen! No user error can get here.
145  bool Invalid_JobMode_in_ctor_of_MessageLoggerDefaults = false;
146  assert(Invalid_JobMode_in_ctor_of_MessageLoggerDefaults);
147  } // end of switch on mode
148  }
149  };
150 
151  } // end of namespace service
152 } // end of namespace edm
153 
154 #endif // MessageLogger_MessageLoggerDefaults_h
service
Definition: service.py:1
edm::service::MessageLoggerDefaults::Destination::sev
std::map< std::string, Category > sev
Definition: MessageLoggerDefaults.h:84
edm::service::MessageLoggerDefaults::Destination::category
std::map< std::string, Category > category
Definition: MessageLoggerDefaults.h:83
edm::service::MessageLoggerDefaults::limit
int limit(std::string const &dest, std::string const &cat)
Definition: MessageLoggerDefaults.cc:52
edm::service::MessageLoggerDefaults::Category
Definition: MessageLoggerDefaults.h:73
edm::service::MessageLoggerDefaults::hardwireReleaseValidationJobMode
void hardwireReleaseValidationJobMode()
Definition: HardwiredDefaults.cc:100
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::service::MessageLoggerDefaults::Category::threshold
std::string threshold
Definition: MessageLoggerDefaults.h:74
eostools.cat
def cat(path)
Definition: eostools.py:401
edm::service::MessageLoggerDefaults::mode
static edm::JobMode mode(std::string const &jm)
Definition: HardwiredDefaults.cc:30
cms::cuda::assert
assert(be >=bs)
edm::service::MessageLoggerDefaults::Category::Category
Category()
Definition: MessageLoggerDefaults.h:78
edm::service::MessageLoggerDefaults::MessageLoggerDefaults
MessageLoggerDefaults(edm::JobMode mode=GridJobMode)
Definition: MessageLoggerDefaults.h:120
edm::service::MessageLoggerDefaults::sev_limit
int sev_limit(std::string const &dest, std::string const &sev)
Definition: MessageLoggerDefaults.cc:175
edm::service::MessageLoggerDefaults::Destination
Definition: MessageLoggerDefaults.h:81
edm::service::MessageLoggerDefaults::categories
std::vector< std::string > categories
Definition: MessageLoggerDefaults.h:90
edm::service::MessageLoggerDefaults
Definition: MessageLoggerDefaults.h:69
edm::service::MessageLoggerDefaults::hardwireAnalysisJobMode
void hardwireAnalysisJobMode()
Definition: HardwiredDefaults.cc:155
edm::service::MessageLoggerDefaults::sev_timespan
int sev_timespan(std::string const &dest, std::string const &sev)
Definition: MessageLoggerDefaults.cc:257
edm::service::MessageLoggerDefaults::Category::reportEvery
int reportEvery
Definition: MessageLoggerDefaults.h:76
edm::service::MessageLoggerDefaults::destination
std::map< std::string, Destination > destination
Definition: MessageLoggerDefaults.h:94
JobMode.h
edm::AnalysisJobMode
Definition: JobMode.h:15
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::GridJobMode
Definition: JobMode.h:15
edm::service::MessageLoggerDefaults::fwkJobReports
std::vector< std::string > fwkJobReports
Definition: MessageLoggerDefaults.h:92
edm::service::MessageLoggerDefaults::Category::limit
int limit
Definition: MessageLoggerDefaults.h:75
edm::service::MessageLoggerDefaults::timespan
int timespan(std::string const &dest, std::string const &cat)
Definition: MessageLoggerDefaults.cc:134
edm::service::MessageLoggerDefaults::threshold
std::string threshold(std::string const &dest)
Definition: MessageLoggerDefaults.cc:24
edm::service::MessageLoggerDefaults::hardwireNilJobMode
void hardwireNilJobMode()
Definition: HardwiredDefaults.cc:197
edm::ReleaseValidationJobMode
Definition: JobMode.h:15
edm::service::MessageLoggerDefaults::NO_VALUE_SET
static const int NO_VALUE_SET
Definition: MessageLoggerDefaults.h:71
edm::NilJobMode
Definition: JobMode.h:15
edm::JobMode
JobMode
Definition: JobMode.h:15
edm::service::MessageLoggerDefaults::Destination::output
std::string output
Definition: MessageLoggerDefaults.h:85
edm::service::MessageLoggerDefaults::statistics
std::vector< std::string > statistics
Definition: MessageLoggerDefaults.h:93
edm::service::MessageLoggerDefaults::output
std::string output(std::string const &dest)
Definition: MessageLoggerDefaults.cc:41
edm::service::MessageLoggerDefaults::destinations
std::vector< std::string > destinations
Definition: MessageLoggerDefaults.h:91
edm::service::MessageLoggerDefaults::sev_reportEvery
int sev_reportEvery(std::string const &dest, std::string const &sev)
Definition: MessageLoggerDefaults.cc:216
edm::service::MessageLoggerDefaults::Category::timespan
int timespan
Definition: MessageLoggerDefaults.h:77
edm::service::MessageLoggerDefaults::Destination::threshold
std::string threshold
Definition: MessageLoggerDefaults.h:82
mps_fire.dest
dest
Definition: mps_fire.py:179
edm::service::MessageLoggerDefaults::reportEvery
int reportEvery(std::string const &dest, std::string const &cat)
Definition: MessageLoggerDefaults.cc:93
edm::service::MessageLoggerDefaults::hardwireGridJobMode
void hardwireGridJobMode()
Definition: HardwiredDefaults.cc:45