CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
std::map< std::string, Destination > destination
int sev_reportEvery(std::string const &dest, std::string const &sev) const
int sev_limit(std::string const &dest, std::string const &sev) const
int limit(std::string const &dest, std::string const &cat) const
std::vector< std::string > statistics
assert(be >=bs)
std::vector< std::string > destinations
int reportEvery(std::string const &dest, std::string const &cat) const
def cat
Definition: eostools.py:401
std::string threshold(std::string const &dest) const
int sev_timespan(std::string const &dest, std::string const &sev) const
int timespan(std::string const &dest, std::string const &cat) const
std::string output(std::string const &dest) const
MessageLoggerDefaults(edm::JobMode mode=GridJobMode)
static edm::JobMode mode(std::string const &jm)
JobMode
Definition: JobMode.h:15
std::vector< std::string > categories