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> statistics;
93  std::map<std::string, Destination> destination;
94 
95  // access to values set
96 
97  std::string threshold(std::string const& dest) const;
98  std::string output(std::string const& dest) const;
99 
100  int limit(std::string const& dest, std::string const& cat) const;
101  int reportEvery(std::string const& dest, std::string const& cat) const;
102  int timespan(std::string const& dest, std::string const& cat) const;
103 
104  int sev_limit(std::string const& dest, std::string const& sev) const;
105  int sev_reportEvery(std::string const& dest, std::string const& sev) const;
106  int sev_timespan(std::string const& dest, std::string const& sev) const;
107 
108  // Modes with hardwired defaults
109 
110  void hardwireGridJobMode();
113  void hardwireNilJobMode();
114 
115  static edm::JobMode mode(std::string const& jm);
116 
117  // ctor
118 
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  }
148  };
149 
150  } // end of namespace service
151 } // end of namespace edm
152 
153 #endif // MessageLogger_MessageLoggerDefaults_h
edm::service::MessageLoggerDefaults::threshold
std::string threshold(std::string const &dest) const
Definition: MessageLoggerDefaults.cc:24
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::sev_timespan
int sev_timespan(std::string const &dest, std::string const &sev) const
Definition: MessageLoggerDefaults.cc:257
edm::service::MessageLoggerDefaults::timespan
int timespan(std::string const &dest, std::string const &cat) const
Definition: MessageLoggerDefaults.cc:134
edm::service::MessageLoggerDefaults::Category
Definition: MessageLoggerDefaults.h:73
edm::service::MessageLoggerDefaults::hardwireReleaseValidationJobMode
void hardwireReleaseValidationJobMode()
Definition: HardwiredDefaults.cc:86
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:119
edm::service::MessageLoggerDefaults::Destination
Definition: MessageLoggerDefaults.h:81
edm::service::MessageLoggerDefaults::output
std::string output(std::string const &dest) const
Definition: MessageLoggerDefaults.cc:41
edm::service::MessageLoggerDefaults::limit
int limit(std::string const &dest, std::string const &cat) const
Definition: MessageLoggerDefaults.cc:52
edm::service::MessageLoggerDefaults::categories
std::vector< std::string > categories
Definition: MessageLoggerDefaults.h:90
edm::service::MessageLoggerDefaults
Definition: MessageLoggerDefaults.h:69
edm::service::MessageLoggerDefaults::sev_reportEvery
int sev_reportEvery(std::string const &dest, std::string const &sev) const
Definition: MessageLoggerDefaults.cc:216
edm::service::MessageLoggerDefaults::hardwireAnalysisJobMode
void hardwireAnalysisJobMode()
Definition: HardwiredDefaults.cc:127
edm::service::MessageLoggerDefaults::Category::reportEvery
int reportEvery
Definition: MessageLoggerDefaults.h:76
edm::service::MessageLoggerDefaults::destination
std::map< std::string, Destination > destination
Definition: MessageLoggerDefaults.h:93
JobMode.h
edm::AnalysisJobMode
Definition: JobMode.h:15
edm::GridJobMode
Definition: JobMode.h:15
edm::service::MessageLoggerDefaults::Category::limit
int limit
Definition: MessageLoggerDefaults.h:75
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::service::MessageLoggerDefaults::hardwireNilJobMode
void hardwireNilJobMode()
Definition: HardwiredDefaults.cc:165
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::service::MessageLoggerDefaults::reportEvery
int reportEvery(std::string const &dest, std::string const &cat) const
Definition: MessageLoggerDefaults.cc:93
edm::JobMode
JobMode
Definition: JobMode.h:15
edm::service::MessageLoggerDefaults::sev_limit
int sev_limit(std::string const &dest, std::string const &sev) const
Definition: MessageLoggerDefaults.cc:175
edm::service::MessageLoggerDefaults::Destination::output
std::string output
Definition: MessageLoggerDefaults.h:85
edm::service::MessageLoggerDefaults::statistics
std::vector< std::string > statistics
Definition: MessageLoggerDefaults.h:92
edm::service::MessageLoggerDefaults::destinations
std::vector< std::string > destinations
Definition: MessageLoggerDefaults.h:91
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::hardwireGridJobMode
void hardwireGridJobMode()
Definition: HardwiredDefaults.cc:45