00001 #include "FWCore/MessageLogger/interface/LoggedErrorsSummary.h" 00002 #include "FWCore/MessageLogger/interface/MessageSender.h" 00003 00004 // Change log 00005 // 00006 // 1 mf 8/25/08 First implementation 00007 // 00008 // 2 mf 6/22/09 Change to use severity in the key by using entry as key 00009 // Also, LoggedErrorsOnlySummary() 00010 namespace edm { 00011 00012 bool EnableLoggedErrorsSummary() { 00013 bool ret = MessageSender::errorSummaryIsBeingKept; 00014 MessageSender::errorSummaryIsBeingKept = true; 00015 return ret; 00016 } 00017 00018 bool DisableLoggedErrorsSummary(){ 00019 bool ret = MessageSender::errorSummaryIsBeingKept; 00020 MessageSender::errorSummaryIsBeingKept = false; 00021 return ret; 00022 } 00023 00024 bool FreshErrorsExist() { 00025 return MessageSender::freshError; 00026 } 00027 00028 std::vector<ErrorSummaryEntry> LoggedErrorsSummary() { 00029 std::vector<ErrorSummaryEntry> v; 00030 ErrorSummaryEntry e; 00031 ErrorSummaryMapIterator end = MessageSender::errorSummaryMap.end(); 00032 for (ErrorSummaryMapIterator i = MessageSender::errorSummaryMap.begin(); 00033 i != end; ++i) { 00034 e = i->first; // sets category, module and severity ChangeLog 2 00035 e.count = (i->second); // count is 0 in key; set it to correct value 00036 v.push_back(e); 00037 } 00038 MessageSender::freshError = false; 00039 MessageSender::errorSummaryMap.clear(); 00040 return v; 00041 } 00042 00043 std::vector<ErrorSummaryEntry> LoggedErrorsOnlySummary() { // ChangeLog 2 00044 std::vector<ErrorSummaryEntry> v; 00045 ErrorSummaryEntry e; 00046 ErrorSummaryMapIterator end = MessageSender::errorSummaryMap.end(); 00047 for (ErrorSummaryMapIterator i = MessageSender::errorSummaryMap.begin(); 00048 i != end; ++i) { 00049 e = i->first; 00050 if (e.severity >= edm::ELerror) { 00051 e.count = (i->second); 00052 v.push_back(e); 00053 } 00054 } 00055 MessageSender::freshError = false; 00056 MessageSender::errorSummaryMap.clear(); 00057 return v; 00058 } 00059 00060 } // end namespace edm