00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include <iostream>
00029
00030 #include "FWCore/MessageService/interface/ELdestination.h"
00031 #include "FWCore/MessageService/interface/ELdestControl.h"
00032
00033
00034
00035
00036 namespace edm {
00037 namespace service {
00038
00039 #ifdef DEFECT_NO_STATIC_CONST_INIT
00040 const int ELdestination::defaultLineLength = 80;
00041 #endif
00042
00043 ELdestination::ELdestination()
00044 : threshold ( ELzeroSeverity )
00045 , traceThreshold( ELhighestSeverity )
00046 , limits ( )
00047 , preamble ( "%MSG" )
00048 , newline ( "\n" )
00049 , indent ( " " )
00050 , lineLength ( defaultLineLength )
00051 , ignoreMostModules (false)
00052 , respondToThese()
00053 , respondToMostModules (false)
00054 , ignoreThese()
00055 {
00056
00057 #ifdef ELdestinationCONSTRUCTOR_TRACE
00058 std::cerr << "Constructor for ELdestination\n";
00059 #endif
00060
00061 }
00062
00063
00064 ELdestination::~ELdestination() {
00065
00066 #ifdef ELdestinationCONSTRUCTOR_TRACE
00067 std::cerr << "Destructor for ELdestination\n";
00068 #endif
00069
00070 }
00071
00072
00073
00074
00075
00076
00077 bool ELdestination::log( const edm::ErrorObj & msg ) { return false; }
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090 static ELstring noSummarizationMsg = "No summarization()";
00091 static ELstring noSummaryMsg = "No summary()";
00092 static ELstring noClearSummaryMsg = "No clearSummary()";
00093 static ELstring hereMsg = "available via this destination";
00094 static ELstring noosMsg = "No ostream";
00095 static ELstring notELoutputMsg = "This destination is not an ELoutput";
00096
00097 void ELdestination::clearSummary() {
00098
00099 edm::ErrorObj msg( ELwarning2, noClearSummaryMsg );
00100 msg << hereMsg;
00101 log( msg );
00102
00103 }
00104
00105
00106 void ELdestination::wipe() { limits.wipe(); }
00107
00108
00109 void ELdestination::zero() { limits.zero(); }
00110
00111 void ELdestination::respondToModule( ELstring const & moduleName ) {
00112 if (moduleName=="*") {
00113 ignoreMostModules = false;
00114 respondToMostModules = true;
00115 ignoreThese.clear();
00116 respondToThese.clear();
00117 } else {
00118 respondToThese.insert(moduleName);
00119 ignoreThese.erase(moduleName);
00120 }
00121 }
00122
00123 void ELdestination::ignoreModule( ELstring const & moduleName ) {
00124 if (moduleName=="*") {
00125 respondToMostModules = false;
00126 ignoreMostModules = true;
00127 respondToThese.clear();
00128 ignoreThese.clear();
00129 } else {
00130 ignoreThese.insert(moduleName);
00131 respondToThese.erase(moduleName);
00132 }
00133 }
00134
00135 void ELdestination::filterModule( ELstring const & moduleName ) {
00136 ignoreModule("*");
00137 respondToModule(moduleName);
00138 }
00139
00140 void ELdestination::excludeModule( ELstring const & moduleName ) {
00141 respondToModule("*");
00142 ignoreModule(moduleName);
00143 }
00144
00145 void ELdestination::summary( ) { }
00146
00147 void ELdestination::summary( ELdestControl & dest, const ELstring & title ) {
00148
00149 edm::ErrorObj msg( ELwarning2, noSummaryMsg );
00150 msg << noSummaryMsg << " " << hereMsg << dest.getNewline() << title;
00151 dest.log( msg );
00152
00153 }
00154
00155
00156 void ELdestination::summary( std::ostream & os, const ELstring & title ) {
00157
00158 os << "%MSG" << ELwarning2.getSymbol() << " "
00159 << noSummaryMsg << " " << hereMsg << std::endl
00160 << title << std::endl;
00161
00162 }
00163
00164
00165 void ELdestination::summary( ELstring & s, const ELstring & title ) {
00166
00167 s = ELstring("%MSG") + ELwarning2.getSymbol() + " "
00168 + noSummaryMsg + " " + hereMsg + "\n"
00169 + title + "\n";
00170
00171 }
00172
00173 void ELdestination::summaryForJobReport(std::map<std::string, double> & sm) { }
00174
00175 void ELdestination::finish() { }
00176
00177 void ELdestination::setTableLimit( int n ) { limits.setTableLimit( n ); }
00178
00179
00180 void ELdestination::summarization(
00181 const ELstring & title
00182 , const ELstring & sumLines ) {
00183
00184 edm::ErrorObj msg( ELwarning2, noSummarizationMsg );
00185 msg << hereMsg << newline << title;
00186 log( msg );
00187
00188 }
00189
00190 std::map<ELextendedID , StatsCount> ELdestination::statisticsMap() const {
00191 return std::map<ELextendedID , StatsCount> ();
00192 }
00193
00194 void ELdestination::changeFile (std::ostream & os) {
00195 edm::ErrorObj msg( ELwarning2, noosMsg );
00196 msg << notELoutputMsg;
00197 log( msg );
00198 }
00199
00200 void ELdestination::changeFile (const ELstring & filename) {
00201 edm::ErrorObj msg( ELwarning2, noosMsg );
00202 msg << notELoutputMsg << newline << "file requested is" << filename;
00203 log( msg );
00204 }
00205
00206 void ELdestination::flush () {
00207 edm::ErrorObj msg( ELwarning2, noosMsg );
00208 msg << "cannot flush()";
00209 log( msg );
00210 }
00211
00212
00213
00214
00215
00216 void ELdestination::suppressText() { ; }
00217 void ELdestination::includeText() { ; }
00218
00219 void ELdestination::suppressModule() { ; }
00220 void ELdestination::includeModule() { ; }
00221
00222 void ELdestination::suppressSubroutine() { ; }
00223 void ELdestination::includeSubroutine() { ; }
00224
00225 void ELdestination::suppressTime() { ; }
00226 void ELdestination::includeTime() { ; }
00227
00228 void ELdestination::suppressContext() { ; }
00229 void ELdestination::includeContext() { ; }
00230
00231 void ELdestination::suppressSerial() { ; }
00232 void ELdestination::includeSerial() { ; }
00233
00234 void ELdestination::useFullContext() { ; }
00235 void ELdestination::useContext() { ; }
00236
00237 void ELdestination::separateTime() { ; }
00238 void ELdestination::attachTime() { ; }
00239
00240 void ELdestination::separateEpilogue() { ; }
00241 void ELdestination::attachEpilogue() { ; }
00242
00243 void ELdestination::noTerminationSummary() { ; }
00244
00245 ELstring ELdestination::getNewline() const { return newline; }
00246
00247 int ELdestination::setLineLength (int len) {
00248 int temp=lineLength;
00249 lineLength = len;
00250 return temp;
00251 }
00252
00253 int ELdestination::getLineLength () const { return lineLength; }
00254
00255
00256
00257
00258
00259
00260 bool ELdestination::thisShouldBeIgnored(const ELstring & s) const {
00261 if (respondToMostModules) {
00262 return ( ignoreThese.find(s) != ignoreThese.end() );
00263 } else if (ignoreMostModules) {
00264 return ( respondToThese.find(s) == respondToThese.end() );
00265 } else {
00266 return false;
00267 }
00268 }
00269
00270 }
00271 }