CMS 3D CMS Logo

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