All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
IssueSeverity.cpp
Go to the documentation of this file.
1 #define GAUDIKERNEL_ISSUESEVERITY_CPP 1
2 
6 #include "GaudiKernel/System.h"
9 
10 #include <sstream>
11 
12 bool IssueSeverity::m_init(false);
14 
15 
17  if (!m_reported) {
18  report();
19  // do stuff
20  }
21 }
22 
23 void
25  if (!m_init) {
26  m_init = true;
27  m_ers = Gaudi::svcLocator()->service<IIssueLogger>("IssueLogger").get();
28  }
29  if (m_ers) {
30  m_ers->report(*this);
31  } else {
32  std::cerr << *this << std::endl;
33  }
34  m_reported = true;
35 }
36 
39  return m_file + ":" + std::to_string(m_line);
40 }
41 
static bool m_init
static IIssueLogger * m_ers
std::string getOrigin() const
virtual void report(IssueSeverity::Level level, const std::string &msg, const std::string &origin)=0
T to_string(T...args)
T endl(T...args)
std::string m_file
Definition: IssueSeverity.h:93
STL class.
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:78
GAUDI_API ISvcLocator * svcLocator()