CMS 3D CMS Logo

WarningSummary.cc
Go to the documentation of this file.
3 
4 #include <algorithm>
5 
7  const auto wIt = std::find_if(
8  std::begin(m_warnings), std::end(m_warnings), [&message](const std::pair<std::string, std::size_t>& item) {
9  return item.first == message;
10  });
11  if (std::end(m_warnings) == wIt) {
12  m_warnings.emplace(message, 1);
13  edm::LogWarning(m_category) << message << ": " << details
14  << (m_debug ? ""
15  : "\nNote: further warnings of this type will be suppressed (this can be "
16  "changed by enabling debugging printout)");
17  } else {
18  ++(wIt->second);
19  if (m_debug) {
20  edm::LogWarning(m_category) << message << ": " << details;
21  }
22  }
23 }
24 
26  if (!m_warnings.empty()) {
27  std::stringstream message;
28  message << m_name << " warnings:";
29  for (const auto& warnAndCount : m_warnings) {
30  message << std::endl << warnAndCount.first << " (" << warnAndCount.second << ")";
31  }
32  edm::LogWarning(m_category) << message.str();
33  }
34 }
sistrip::WarningSummary::m_warnings
std::map< std::string, std::size_t > m_warnings
Definition: WarningSummary.h:20
MessageLogger.h
sistrip::WarningSummary::m_category
std::string m_category
Definition: WarningSummary.h:18
sistrip::WarningSummary::add
void add(const std::string &message, const std::string &details="")
Definition: WarningSummary.cc:6
sistrip::WarningSummary::printSummary
void printSummary() const
Definition: WarningSummary.cc:25
end
#define end
Definition: vmac.h:39
details
Definition: helper.h:56
sistrip::WarningSummary::m_debug
bool m_debug
Definition: WarningSummary.h:17
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogWarning
Definition: MessageLogger.h:141
WarningSummary.h
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
begin
#define begin
Definition: vmac.h:32