ATLAS Offline Software
MessagePrinterErrorCollect.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 
9 //
10 // includes
11 //
12 
14 
15 #include <regex>
16 
17 //
18 // method implementations
19 //
20 
21 #ifdef XAOD_STANDALONE
22 
23 namespace asg
24 {
26  print (MSG::Level reglvl, const std::string& /*name*/,
27  const std::string& text)
28  {
29  if (reglvl >= MSG::ERROR)
30  {
31  m_errorMessages.push_back (text);
32  }
33  }
34 
35 
36 
37  bool MessagePrinterErrorCollect ::
38  empty () const noexcept
39  {
40  return m_errorMessages.empty();
41  }
42 
43 
44 
46  matchesRegex (const std::string& pattern) const
47  {
49  for (auto& msg : m_errorMessages)
50  {
51  if (std::regex_search (msg, regex))
52  return true;
53  }
54  return false;
55  }
56 
57 
58 
59  std::string MessagePrinterErrorCollect ::
60  asString (const std::string& prefix) const
61  {
62  std::string result;
63  for (auto& msg : m_errorMessages)
64  {
65  if (!result.empty())
66  result += "\n";
67  result += prefix + msg;
68  }
69  return result;
70  }
71 }
72 
73 #endif
mergePhysValFiles.pattern
pattern
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:26
get_generator_info.result
result
Definition: get_generator_info.py:21
asg
Definition: DataHandleTestTool.h:28
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
PrepareReferenceFile.regex
regex
Definition: PrepareReferenceFile.py:43
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
asg::detail::matchesRegex
bool matchesRegex(const std::string &regex, const std::string &str)
return whether str matches regex
Definition: Control/AthToolSupport/AsgTesting/Root/UnitTest.cxx:25
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
MessagePrinterErrorCollect.h
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28
makeTransCanvas.text
text
Definition: makeTransCanvas.py:11
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7