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 // $Id: MessageLoggerDefaults.h,v 1.3 2008/07/10 16:15:13 fischler Exp $
28 //
29 
30 // Framework include files
31 
33 
34 // system include files
35 
36 #include <string>
37 #include <vector>
38 #include <map>
39 #include <cassert>
40 
41 // Change log
42 //
43 // 6/15/07 mf Original version
44 //
45 // -------------------------------------------------------
46 
47 // user include files
48 
49 // ----------------
50 // Maintenance Tips
51 // ----------------
52 //
53 // When default values change for one job mode of operation or another,
54 // implement that change in the appropriate member function implemented
55 // in HardwiredDefaults.cc. For example, hardwireGridJobMode().
56 //
57 // When a new default is needed, add the item to the struct, and then place
58 // the default value into the appropriate sections of the various member
59 // functions in HardwiredDefaults.cc.
60 // It may be necessary to supply values of that default for each of the modes,
61 // even though the ErrorLogger default is suitable for all the modes but one.
62 //
63 // When the new default is of a type not already being accessed, also add
64 // the accessor method in this header, and implement it in
65 // MessageLoggerDefaults.cc following the pattern shown for existing items
66 
67 namespace edm {
68 namespace service {
69 
71 public:
72  static const int NO_VALUE_SET = -45654;
73 
74  struct Category {
76  int limit;
78  int timespan;
79  Category() :
80  threshold("")
84  };
85 
86  struct Destination {
88  std::map<std::string,Category> category;
89  std::map<std::string,Category> sev;
91  };
92 
93  // publicly available collections and structures
94 
95  std::vector<std::string> categories;
96  std::vector<std::string> destinations;
97  std::vector<std::string> fwkJobReports;
98  std::vector<std::string> statistics;
99  std::map<std::string,Destination> destination;
100 
101  // access to values set
102 
105 
106  int limit (std::string const & dest, std::string const & cat);
107  int reportEvery(std::string const & dest, std::string const & cat);
108  int timespan (std::string const & dest, std::string const & cat);
109 
110  int sev_limit (std::string const & dest, std::string const & sev);
111  int sev_reportEvery(std::string const & dest, std::string const & sev);
112  int sev_timespan (std::string const & dest, std::string const & sev);
113 
114  // Modes with hardwired defaults
115 
116  void hardwireGridJobMode();
119  void hardwireNilJobMode();
120 
121  static edm::JobMode mode(std::string const & jm);
122 
123  // ctor
124 
126  // mode-independent defaults
127 
128  // mode-dependent defaults
129  switch (mode) {
130  // GridJobMode: Intended for automated batch-like processing, in which
131  // the output stream for cerr is routed to an apropro
132  // file. LogInfo messages are enabled, and at least
133  // one such message is delivered from the framework per
134  // event, so this mode is not suitable for many-Hz light
135  // event processing.
136  case GridJobMode:
138  break;
141  break;
142  case AnalysisJobMode:
144  break;
145  case NilJobMode:
147  break;
148  default:
149  // this should never happen! No user error can get here.
150  bool Invalid_JobMode_in_ctor_of_MessageLoggerDefaults = false;
151  assert (Invalid_JobMode_in_ctor_of_MessageLoggerDefaults);
152  } // end of switch on mode
153  }
154 
155 };
156 
157 
158 
159 } // end of namespace service
160 } // end of namespace edm
161 
162 
163 #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)