CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
edm::ErrorObj Class Reference

#include <ErrorObj.h>

Public Member Functions

virtual void clear ()
 
const std::string & context () const
 
virtual ErrorObjemitToken (std::string_view txt)
 
 ErrorObj (const ErrorObj &orig)
 
 ErrorObj (const messagelogger::ELseverityLevel &sev, std::string_view id, bool verbatim=false)
 
template<typename... Args>
ErrorObjformat (std::string_view fmt, Args const &... args)
 
std::string fullText () const
 
const std::string & idOverflow () const
 
bool is_verbatim () const
 
const ELlist_stringitems () const
 
ErrorObjoperator<< (std::ios_base &(*f)(std::ios_base &))
 
ErrorObjoperator<< (std::ostream &(*f)(std::ostream &))
 
ErrorObjoperator= (const ErrorObj &other)
 
ErrorObjopltlt (const char s[])
 
template<class T >
ErrorObjopltlt (const T &t)
 
bool reactedTo () const
 
int serial () const
 
virtual void set (const messagelogger::ELseverityLevel &sev, std::string_view id)
 
virtual void setContext (std::string_view context)
 
virtual void setID (std::string_view ID)
 
virtual void setModule (std::string_view module)
 
virtual void setReactedTo (bool r)
 
virtual void setSeverity (const messagelogger::ELseverityLevel &sev)
 
virtual void setSubroutine (std::string_view subroutine)
 
void swap (ErrorObj &other)
 
time_t timestamp () const
 
const ELextendedIDxid () const
 
virtual ~ErrorObj ()
 

Private Attributes

std::string emptyString
 
std::string myContext
 
std::string myIdOverflow
 
ELlist_string myItems
 
std::ostringstream myOs
 
bool myReactedTo
 
int mySerial
 
time_t myTimestamp
 
ELextendedID myXid
 
bool verbatim
 

Detailed Description

Definition at line 43 of file ErrorObj.h.

Constructor & Destructor Documentation

◆ ErrorObj() [1/2]

edm::ErrorObj::ErrorObj ( const messagelogger::ELseverityLevel sev,
std::string_view  id,
bool  verbatim = false 
)

Definition at line 83 of file ErrorObj.cc.

83  : verbatim(verbat) {
84 #ifdef ErrorObjCONSTRUCTOR_TRACE
85  std::cerr << "Constructor for ErrorObj\n";
86 #endif
87 
88  clear();
89  set(sev, id);
90 
91  } // ErrorObj()

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, clear(), and set().

◆ ErrorObj() [2/2]

edm::ErrorObj::ErrorObj ( const ErrorObj orig)

Definition at line 93 of file ErrorObj.cc.

94  : mySerial(orig.mySerial),
95  myXid(orig.myXid),
96  myIdOverflow(orig.myIdOverflow),
97  myTimestamp(orig.myTimestamp),
98  myItems(orig.myItems),
99  myReactedTo(orig.myReactedTo),
100  myOs(),
101  emptyString(),
102  verbatim(orig.verbatim) {
103 #ifdef ErrorObjCONSTRUCTOR_TRACE
104  std::cerr << "Copy Constructor for ErrorObj\n";
105 #endif
106 
107  } // ErrorObj(ErrorObj)

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr.

◆ ~ErrorObj()

edm::ErrorObj::~ErrorObj ( )
virtual

Definition at line 109 of file ErrorObj.cc.

109  {
110 #ifdef ErrorObjCONSTRUCTOR_TRACE
111  std::cerr << "Destructor for ErrorObj\n";
112 #endif
113 
114  } // ~ErrorObj()

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr.

Member Function Documentation

◆ clear()

void edm::ErrorObj::clear ( void  )
virtual

Definition at line 227 of file ErrorObj.cc.

227  {
228  mySerial = 0;
229  myXid.clear();
230  myIdOverflow = "";
231  myTimestamp = 0;
232  myItems.erase(myItems.begin(), myItems.end()); // myItems.clear();
233  myReactedTo = false;
234 
235  } // clear()

References edm::ELextendedID::clear(), myIdOverflow, myItems, myReactedTo, mySerial, myTimestamp, and myXid.

Referenced by ErrorObj(), and set().

◆ context()

const std::string & edm::ErrorObj::context ( ) const

Definition at line 149 of file ErrorObj.cc.

149 { return myContext; }

References myContext.

◆ emitToken()

ErrorObj & edm::ErrorObj::emitToken ( std::string_view  txt)
virtual

Definition at line 191 of file ErrorObj.cc.

191  {
192 #ifdef ErrorObj_EMIT_TRACE
193  std::cerr << "=:=:=: ErrorObj::emitToken( " << s << " )\n";
194 #endif
195 
196 #ifdef ErrorObj_SUB_TRACE
197  if (subN > 0) {
198  std::cerr << "=:=:=: subN ErrorObj::emitToken( " << s << " )\n";
199  subN--;
200  }
201 #endif
202 
203  if (eq_nocase(s.substr(0, 5), "@SUB=")) {
204 #ifdef ErrorObj_SUB_TRACE
205  std::cerr << "=:=:=: ErrorObj::@SUB s.substr(5) is: " << s.substr(5) << '\n';
206 #endif
207  setSubroutine(s.substr(5));
208  } else {
209  myItems.emplace_back(s);
210  }
211 
212  return *this;
213 
214  } // emitToken()

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, myItems, alignCSCRings::s, and setSubroutine().

Referenced by opltlt().

◆ format()

template<typename... Args>
ErrorObj& edm::ErrorObj::format ( std::string_view  fmt,
Args const &...  args 
)
inline

◆ fullText()

std::string edm::ErrorObj::fullText ( ) const

Definition at line 151 of file ErrorObj.cc.

151  {
153  for (auto const& it : myItems)
154  result += it;
155  return result;
156  } // fullText()

References myItems, mps_fire::result, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ idOverflow()

const std::string & edm::ErrorObj::idOverflow ( ) const

Definition at line 143 of file ErrorObj.cc.

143 { return myIdOverflow; }

References myIdOverflow.

◆ is_verbatim()

bool edm::ErrorObj::is_verbatim ( ) const

Definition at line 147 of file ErrorObj.cc.

147 { return verbatim; }

References verbatim.

◆ items()

const ELlist_string & edm::ErrorObj::items ( ) const

◆ operator<<() [1/2]

ErrorObj& edm::ErrorObj::operator<< ( std::ios_base &(*)(std::ios_base &)  f)
inline

◆ operator<<() [2/2]

ErrorObj& edm::ErrorObj::operator<< ( std::ostream &(*)(std::ostream &)  f)
inline

◆ operator=()

ErrorObj & edm::ErrorObj::operator= ( const ErrorObj other)

Definition at line 116 of file ErrorObj.cc.

116  {
118  this->swap(temp);
119  return *this;
120  }

References trackingPlots::other, swap(), and groupFilesInBlocks::temp.

◆ opltlt() [1/2]

ErrorObj & edm::ErrorObj::opltlt ( const char  s[])

Definition at line 237 of file ErrorObj.cc.

237  {
238  // Exactly equivalent to the general template.
239  // If this is not provided explicitly, then the template will
240  // be instantiated once for each length of string ever used.
241  myOs.str(emptyString);
242  myOs << s;
243 #ifdef OLD_STYLE_AUTOMATIC_SPACES
244  if (!myOs.str().empty()) {
245  if (!verbatim) {
246  emitToken(myOs.str() + ' ');
247  } else {
248  emitToken(myOs.str());
249  }
250  }
251 #else
252  if (!myOs.str().empty())
253  emitToken(myOs.str());
254 #endif
255  return *this;
256  }

References emitToken(), emptyString, myOs, alignCSCRings::s, and verbatim.

◆ opltlt() [2/2]

template<class T >
ErrorObj& edm::ErrorObj::opltlt ( const T t)
inline

◆ reactedTo()

bool edm::ErrorObj::reactedTo ( ) const

Definition at line 146 of file ErrorObj.cc.

146 { return myReactedTo; }

References myReactedTo.

◆ serial()

int edm::ErrorObj::serial ( ) const

Definition at line 141 of file ErrorObj.cc.

141 { return mySerial; }

References mySerial.

◆ set()

void edm::ErrorObj::set ( const messagelogger::ELseverityLevel sev,
std::string_view  id 
)
virtual

Definition at line 216 of file ErrorObj.cc.

216  {
217  clear();
218 
219  myTimestamp = time(nullptr);
220  mySerial = ++ourSerial;
221 
222  setID(id);
223  setSeverity(sev);
224 
225  } // set()

References clear(), mySerial, myTimestamp, edm::ourSerial(), setID(), setSeverity(), and protons_cff::time.

Referenced by ErrorObj().

◆ setContext()

void edm::ErrorObj::setContext ( std::string_view  context)
virtual

Definition at line 176 of file ErrorObj.cc.

176 { myContext = c; }

References c, and myContext.

Referenced by edm::MessageSender::ErrorObjDeleter::operator()().

◆ setID()

void edm::ErrorObj::setID ( std::string_view  ID)
virtual

Definition at line 168 of file ErrorObj.cc.

168  {
169  myXid.id = id.substr(0, maxIDlength);
170  if (id.length() > maxIDlength)
171  myIdOverflow = id.substr(maxIDlength, id.length() - maxIDlength);
172  }

References edm::ELextendedID::id, edm::maxIDlength(), myIdOverflow, and myXid.

Referenced by edm::service::ThreadSafeLogMessageLoggerScribe::log(), set(), and edm::service::ThreadSafeLogMessageLoggerScribe::~ThreadSafeLogMessageLoggerScribe().

◆ setModule()

void edm::ErrorObj::setModule ( std::string_view  module)
virtual

Definition at line 174 of file ErrorObj.cc.

174 { myXid.module = module; }

References edm::ELextendedID::module, and myXid.

Referenced by edm::MessageSender::ErrorObjDeleter::operator()().

◆ setReactedTo()

void edm::ErrorObj::setReactedTo ( bool  r)
virtual

Definition at line 185 of file ErrorObj.cc.

185 { myReactedTo = r; }

References myReactedTo, and alignCSCRings::r.

◆ setSeverity()

void edm::ErrorObj::setSeverity ( const messagelogger::ELseverityLevel sev)
virtual

Definition at line 162 of file ErrorObj.cc.

162  {
163  using namespace edm::messagelogger;
165  : (sev >= ELhighestSeverity) ? (ELseverityLevel)ELsevere : sev;
166  }

References edm::ELdebug, edm::ELhighestSeverity, edm::ELsevere, edm::ELzeroSeverity, myXid, and edm::ELextendedID::severity.

Referenced by set().

◆ setSubroutine()

void edm::ErrorObj::setSubroutine ( std::string_view  subroutine)
virtual

Definition at line 178 of file ErrorObj.cc.

178  {
179 #ifdef ErrorObj_SUB_TRACE
180  std::cerr << "=:=:=: ErrorObj::setSubroutine(" << subroutine << ")\n";
181 #endif
182  myXid.subroutine = (subroutine[0] == ' ') ? subroutine.substr(1) : subroutine;
183  }

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, myXid, and edm::ELextendedID::subroutine.

Referenced by emitToken().

◆ swap()

void edm::ErrorObj::swap ( ErrorObj other)

Definition at line 122 of file ErrorObj.cc.

122  {
123  std::swap(mySerial, other.mySerial);
124  std::swap(myXid, other.myXid);
125  myIdOverflow.swap(other.myIdOverflow);
126  std::swap(myTimestamp, other.myTimestamp);
127  myItems.swap(other.myItems);
128  std::swap(myReactedTo, other.myReactedTo);
129  myContext.swap(other.myContext);
130  std::string temp(other.myOs.str());
131  other.myOs.str(myOs.str());
132  myOs.str(temp);
133  emptyString.swap(other.emptyString);
134  std::swap(verbatim, other.verbatim);
135  }

References emptyString, myContext, myIdOverflow, myItems, myOs, myReactedTo, mySerial, myTimestamp, myXid, trackingPlots::other, AlCaHLTBitMon_QueryRunRegistry::string, std::swap(), groupFilesInBlocks::temp, and verbatim.

Referenced by operator=().

◆ timestamp()

time_t edm::ErrorObj::timestamp ( ) const

Definition at line 144 of file ErrorObj.cc.

144 { return myTimestamp; }

References myTimestamp.

◆ xid()

const ELextendedID & edm::ErrorObj::xid ( ) const

Member Data Documentation

◆ emptyString

std::string edm::ErrorObj::emptyString
private

Definition at line 102 of file ErrorObj.h.

Referenced by opltlt(), and swap().

◆ myContext

std::string edm::ErrorObj::myContext
private

Definition at line 100 of file ErrorObj.h.

Referenced by context(), setContext(), and swap().

◆ myIdOverflow

std::string edm::ErrorObj::myIdOverflow
private

Definition at line 96 of file ErrorObj.h.

Referenced by clear(), idOverflow(), setID(), and swap().

◆ myItems

ELlist_string edm::ErrorObj::myItems
private

Definition at line 98 of file ErrorObj.h.

Referenced by clear(), emitToken(), fullText(), items(), and swap().

◆ myOs

std::ostringstream edm::ErrorObj::myOs
private

Definition at line 101 of file ErrorObj.h.

Referenced by opltlt(), and swap().

◆ myReactedTo

bool edm::ErrorObj::myReactedTo
private

Definition at line 99 of file ErrorObj.h.

Referenced by clear(), reactedTo(), setReactedTo(), and swap().

◆ mySerial

int edm::ErrorObj::mySerial
private

Definition at line 94 of file ErrorObj.h.

Referenced by clear(), serial(), set(), and swap().

◆ myTimestamp

time_t edm::ErrorObj::myTimestamp
private

Definition at line 97 of file ErrorObj.h.

Referenced by clear(), set(), swap(), and timestamp().

◆ myXid

ELextendedID edm::ErrorObj::myXid
private

Definition at line 95 of file ErrorObj.h.

Referenced by clear(), setID(), setModule(), setSeverity(), setSubroutine(), swap(), and xid().

◆ verbatim

bool edm::ErrorObj::verbatim
private

Definition at line 103 of file ErrorObj.h.

Referenced by is_verbatim(), opltlt(), and swap().

edm::ELextendedID::module
std::string module
Definition: ELextendedID.h:31
edm::ErrorObj::emitToken
virtual ErrorObj & emitToken(std::string_view txt)
Definition: ErrorObj.cc:191
edm::ELhighestSeverity
constexpr const ELseverityLevel ELhighestSeverity
Definition: ELseverityLevel.h:96
edm::ourSerial
static std::atomic< int > ourSerial(0)
edm::ErrorObj::mySerial
int mySerial
Definition: ErrorObj.h:94
edm::ErrorObj::myIdOverflow
std::string myIdOverflow
Definition: ErrorObj.h:96
edm::ErrorObj::myItems
ELlist_string myItems
Definition: ErrorObj.h:98
protons_cff.time
time
Definition: protons_cff.py:39
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
edm::ErrorObj::setSeverity
virtual void setSeverity(const messagelogger::ELseverityLevel &sev)
Definition: ErrorObj.cc:162
edm::ErrorObj::myContext
std::string myContext
Definition: ErrorObj.h:100
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edm::ELextendedID::severity
messagelogger::ELseverityLevel severity
Definition: ELextendedID.h:30
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
trackingPlots.other
other
Definition: trackingPlots.py:1460
edm::ErrorObj::setID
virtual void setID(std::string_view ID)
Definition: ErrorObj.cc:168
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ELsevere
constexpr const ELseverityLevel ELsevere
Definition: ELseverityLevel.h:94
edm::maxIDlength
const unsigned int maxIDlength(200)
edm::ErrorObj::myReactedTo
bool myReactedTo
Definition: ErrorObj.h:99
edm::ErrorObj::clear
virtual void clear()
Definition: ErrorObj.cc:227
edm::ErrorObj::emptyString
std::string emptyString
Definition: ErrorObj.h:102
edm::ErrorObj::myXid
ELextendedID myXid
Definition: ErrorObj.h:95
edm::ELdebug
constexpr const ELseverityLevel ELdebug
Definition: ELseverityLevel.h:82
alignCSCRings.r
r
Definition: alignCSCRings.py:93
edm::ErrorObj::myOs
std::ostringstream myOs
Definition: ErrorObj.h:101
edm::ELextendedID::clear
void clear()
Definition: ELextendedID.cc:46
edm::ELextendedID::id
std::string id
Definition: ELextendedID.h:29
edm::ErrorObj::ErrorObj
ErrorObj(const messagelogger::ELseverityLevel &sev, std::string_view id, bool verbatim=false)
Definition: ErrorObj.cc:83
edm::ErrorObj::verbatim
bool verbatim
Definition: ErrorObj.h:103
edm::ErrorObj::myTimestamp
time_t myTimestamp
Definition: ErrorObj.h:97
edm::messagelogger::ELseverityLevel
Definition: ELseverityLevel.h:26
edm::ErrorObj::swap
void swap(ErrorObj &other)
Definition: ErrorObj.cc:122
mps_fire.result
result
Definition: mps_fire.py:311
edm::ELextendedID::subroutine
std::string subroutine
Definition: ELextendedID.h:32
edm::ErrorObj::set
virtual void set(const messagelogger::ELseverityLevel &sev, std::string_view id)
Definition: ErrorObj.cc:216
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
edm::ErrorObj::setSubroutine
virtual void setSubroutine(std::string_view subroutine)
Definition: ErrorObj.cc:178
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
edm::ELzeroSeverity
constexpr const ELseverityLevel ELzeroSeverity
Definition: ELseverityLevel.h:80
edm::messagelogger
Definition: ELseverityLevel.h:21