CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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;
78  Category() :
79  threshold("")
83  };
84 
85  struct Destination {
87  std::map<std::string,Category> category;
88  std::map<std::string,Category> sev;
90  };
91 
92  // publicly available collections and structures
93 
94  std::vector<std::string> categories;
95  std::vector<std::string> destinations;
96  std::vector<std::string> fwkJobReports;
97  std::vector<std::string> statistics;
98  std::map<std::string,Destination> destination;
99 
100  // access to values set
101 
104 
105  int limit (std::string const & dest, std::string const & cat);
106  int reportEvery(std::string const & dest, std::string const & cat);
107  int timespan (std::string const & dest, std::string const & cat);
108 
109  int sev_limit (std::string const & dest, std::string const & sev);
110  int sev_reportEvery(std::string const & dest, std::string const & sev);
111  int sev_timespan (std::string const & dest, std::string const & sev);
112 
113  // Modes with hardwired defaults
114 
115  void hardwireGridJobMode();
118  void hardwireNilJobMode();
119 
120  static edm::JobMode mode(std::string const & jm);
121 
122  // ctor
123 
125  // mode-independent defaults
126 
127  // mode-dependent defaults
128  switch (mode) {
129  // GridJobMode: Intended for automated batch-like processing, in which
130  // the output stream for cerr is routed to an apropro
131  // file. LogInfo messages are enabled, and at least
132  // one such message is delivered from the framework per
133  // event, so this mode is not suitable for many-Hz light
134  // event processing.
135  case GridJobMode:
137  break;
140  break;
141  case AnalysisJobMode:
143  break;
144  case NilJobMode:
146  break;
147  default:
148  // this should never happen! No user error can get here.
149  bool Invalid_JobMode_in_ctor_of_MessageLoggerDefaults = false;
150  assert (Invalid_JobMode_in_ctor_of_MessageLoggerDefaults);
151  } // end of switch on mode
152  }
153 
154 };
155 
156 
157 
158 } // end of namespace service
159 } // end of namespace edm
160 
161 
162 #endif // MessageLogger_MessageLoggerDefaults_h
int timespan(std::string const &dest, std::string const &cat)
std::vector< std::string > fwkJobReports
std::string threshold(std::string const &dest)
std::vector< std::string > statistics
std::string output(std::string const &dest)
std::vector< std::string > destinations
int sev_reportEvery(std::string const &dest, std::string const &sev)
int reportEvery(std::string const &dest, std::string const &cat)
std::map< std::string, Destination > destination
int limit(std::string const &dest, std::string const &cat)
MessageLoggerDefaults(edm::JobMode mode=GridJobMode)
int sev_limit(std::string const &dest, std::string const &sev)
static edm::JobMode mode(std::string const &jm)
JobMode
Definition: JobMode.h:15
std::vector< std::string > categories
int sev_timespan(std::string const &dest, std::string const &sev)