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 }
void printSummary() const
std::map< std::string, std::size_t > m_warnings
Definition: helper.h:70
#define end
Definition: vmac.h:39
void add(const std::string &message, const std::string &details="")
#define begin
Definition: vmac.h:32