Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
// ----------------------------------------------------------------------
//
// HardwiredDefaults.cc
//
// All the hardwired defaults, organized by which JobMode they apply to
//
// JobModes:
//	JobModeGrid
//	JobModeAnalysis
//
// Initial Version:  mf 6/18/07
//
// Changes:
//
// 7/7/08   mf	Statistics with different threshold (WARNING level)
//
// 7/10/08  mf  New mode:  infos --> ReleaseValidationJobMode
//			Statistics at INFO threshold
//			Default limit for INFO at 5 rather than 0
//
// ----------------------------------------------------------------------

#include "FWCore/MessageService/src/MessageLoggerDefaults.h"

#include <iostream>

namespace edm {
  namespace service {

    edm::JobMode MessageLoggerDefaults::mode(std::string const& jm) {
      if (jm.empty())
        return GridJobMode;  // no -mode option = grid
      if (jm == "grid")
        return GridJobMode;
      if (jm == "infos")
        return ReleaseValidationJobMode;
      if (jm == "analysis")
        return AnalysisJobMode;
      if (jm == "nil")
        return NilJobMode;
      std::cerr << "Unrecognized Job Mode Option: " << jm << " -- defaulting to analysis mode ";
      return AnalysisJobMode;
    }

    void MessageLoggerDefaults::hardwireGridJobMode() {
      //	std::cerr << " ======= hardwireGridJobMode() \n";
      destinations.push_back("cerr");
      categories.push_back("FwkReport");
      categories.push_back("FwkSummary");
      categories.push_back("Root_NoDictionary");
      statistics.push_back("cerr_stats");
      // cerr destination -
      //      note that using the name cerr is OK since it is not std::cerr
      //      but when we want to use default as a name, we have to be circumspect
      {
        Destination cerr;         // PSet cerr
        cerr.threshold = "INFO";  // string threshold = "INFO"
        Category INFO_limits;     // PSet INFO = { ... }
        INFO_limits.limit = 0;    // int32 limit = 0
        cerr.sev["INFO"] = INFO_limits;
        Category default_for_dest;          // PSet default
        default_for_dest.limit = 10000000;  // int32 limit = 10000000
        cerr.category["default"] = default_for_dest;
        Category FwkReport;          // PSet FwkReport
        FwkReport.limit = 10000000;  // int32 limit = 10000000
        FwkReport.reportEvery = 1;   // int32 reportEvery = 1
        cerr.category["FwkReport"] = FwkReport;
        Category FwkSummary;          // PSet FwkSummary
        FwkSummary.limit = 10000000;  // int32 limit = 10000000
        FwkSummary.reportEvery = 1;   // int32 reportEvery = 1
        cerr.category["FwkSummary"] = FwkSummary;
        Category Root_NoDictionary;   // PSet Root_NoDictionary
        Root_NoDictionary.limit = 0;  // int32 limit = 0
        cerr.category["Root_NoDictionary"] = Root_NoDictionary;
        destination["cerr"] = cerr;
      }
      {
        Destination cerr_stats;            // PSet cerr_stats
        cerr_stats.threshold = "WARNING";  // string threshold = "WARNING"
        cerr_stats.output = "cerr";        // string output = "cerr"
        destination["cerr_stats"] = cerr_stats;
      }

    }  // hardwireGridJobMode

    void MessageLoggerDefaults::hardwireReleaseValidationJobMode() {
      //	std::cerr << " ======= hardwireReleaseValidationJobMode() \n";
      destinations.push_back("cerr");
      categories.push_back("FwkReport");
      categories.push_back("FwkSummary");
      categories.push_back("Root_NoDictionary");
      statistics.push_back("cerr_stats");
      // cerr destination -
      //      note that using the name cerr is OK since it is not std::cerr
      //      but when we want to use default as a name, we have to be circumspect
      {
        Destination cerr;         // PSet cerr
        cerr.threshold = "INFO";  // string threshold = "INFO"
        Category INFO_limits;     // PSet INFO = { ... }
        INFO_limits.limit = 5;    // int32 limit = 5
        cerr.sev["INFO"] = INFO_limits;
        Category default_for_dest;          // PSet default
        default_for_dest.limit = 10000000;  // int32 limit = 10000000
        cerr.category["default"] = default_for_dest;
        Category FwkReport;          // PSet FwkReport
        FwkReport.limit = 10000000;  // int32 limit = 10000000
        FwkReport.reportEvery = 1;   // int32 reportEvery = 1
        cerr.category["FwkReport"] = FwkReport;
        Category FwkSummary;          // PSet FwkSummary
        FwkSummary.limit = 10000000;  // int32 limit = 10000000
        FwkSummary.reportEvery = 1;   // int32 reportEvery = 1
        cerr.category["FwkSummary"] = FwkSummary;
        Category Root_NoDictionary;   // PSet Root_NoDictionary
        Root_NoDictionary.limit = 0;  // int32 limit = 0
        cerr.category["Root_NoDictionary"] = Root_NoDictionary;
        destination["cerr"] = cerr;
      }
      {
        Destination cerr_stats;         // PSet cerr_stats
        cerr_stats.threshold = "INFO";  // string threshold = "INFO"
        cerr_stats.output = "cerr";     // string output = "cerr"
        destination["cerr_stats"] = cerr_stats;
      }

    }  // hardwireReleaseValidationJobMode

    void MessageLoggerDefaults::hardwireAnalysisJobMode() {
      //	std::cerr << " ======= hardwireAnalysisJobMode() \n";
      destinations.push_back("warnings");
      categories.push_back("FwkReport");
      categories.push_back("FwkSummary");
      categories.push_back("Root_NoDictionary");
      statistics.push_back("cerr");
      // cerr destination -
      //      note that using the name cerr is OK since it is not std::cerr
      //      but when we want to use default as a name, we have to be circumspect
      {
        Destination warnings;         // PSet warnings
        warnings.threshold = "INFO";  // string threshold = "INFO"
        Category INFO_limits;         // PSet INFO = { ... }
        INFO_limits.limit = 0;        // int32 limit = 0
        warnings.sev["INFO"] = INFO_limits;
        Category default_for_dest;      // PSet default
        default_for_dest.limit = 1000;  // int32 limit = 1000
        warnings.category["default"] = default_for_dest;
        Category FwkReport;           // PSet FwkReport
        FwkReport.limit = 10000000;   // int32 limit = 10000000
        FwkReport.reportEvery = 100;  // int32 reportEvery = 100
        warnings.category["FwkReport"] = FwkReport;
        Category FwkSummary;          // PSet FwkSummary
        FwkSummary.limit = 10000000;  // int32 limit = 10000000
        warnings.category["FwkSummary"] = FwkSummary;
        Category Root_NoDictionary;   // PSet Root_NoDictionary
        Root_NoDictionary.limit = 0;  // int32 limit = 0
        warnings.category["Root_NoDictionary"] = Root_NoDictionary;
        destination["warnings"] = warnings;
      }
      {
        Destination cerr;         // PSet cerr
        cerr.threshold = "INFO";  // string threshold = "INFO"
        destination["cerr"] = cerr;
      }
    }  // hardwireAnalysisJobMode

    void MessageLoggerDefaults::hardwireNilJobMode() {
      //	std::cerr << " ======= hardwireNilJobMode() \n";
    }  // hardwireNilJobMode

  }  // end of namespace service
}  // end of namespace edm