CMS 3D CMS Logo

edm::ErrorObj Class Reference

#include <FWCore/MessageLogger/interface/ErrorObj.h>

List of all members.

Public Member Functions

virtual void clear ()
ELstring context () const
virtual ErrorObjemit (const ELstring &txt)
 ErrorObj (const ErrorObj &orig)
 ErrorObj (const ELseverityLevel &sev, const ELstring &id, bool verbatim=false)
ELstring fullText () const
const ELstringidOverflow () const
bool is_verbatim () const
const ELlist_stringitems () const
ErrorObjoperator<< (std::ios_base &(*f)(std::ios_base &))
ErrorObjoperator<< (std::ostream &(*f)(std::ostream &))
ErrorObjopltlt (const char s[])
template<class T>
ErrorObjopltlt (const T &t)
bool reactedTo () const
int serial () const
virtual void set (const ELseverityLevel &sev, const ELstring &id)
virtual void setContext (const ELstring &context)
virtual void setID (const ELstring &ID)
virtual void setModule (const ELstring &module)
virtual void setProcess (const ELstring &proc)
virtual void setReactedTo (bool r)
virtual void setSeverity (const ELseverityLevel &sev)
virtual void setSubroutine (const ELstring &subroutine)
time_t timestamp () const
const ELextendedIDxid () const
virtual ~ErrorObj ()

Private Attributes

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

Static Private Attributes

static int ourSerial


Detailed Description

Definition at line 51 of file ErrorObj.h.


Constructor & Destructor Documentation

edm::ErrorObj::ErrorObj ( const ELseverityLevel sev,
const ELstring id,
bool  verbatim = false 
)

Definition at line 79 of file ErrorObj.cc.

References TestMuL1L2Filter_cff::cerr, and clear().

00081                                    : verbatim(verbat) {
00082 
00083   #ifdef ErrorObjCONSTRUCTOR_TRACE
00084     std::cerr << "Constructor for ErrorObj\n";
00085   #endif
00086 
00087   clear();
00088   set( sev, id );
00089 
00090 }  // ErrorObj()

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

Definition at line 93 of file ErrorObj.cc.

References TestMuL1L2Filter_cff::cerr.

00093                                            :
00094           mySerial        ( orig.mySerial )
00095         , myXid           ( orig.myXid )
00096         , myIdOverflow    ( orig.myIdOverflow )
00097         , myTimestamp     ( orig.myTimestamp )
00098         , myItems         ( orig.myItems )
00099         , myReactedTo     ( orig.myReactedTo )
00100         , myOs            ( )
00101         , emptyString     ( )
00102         , verbatim        ( orig.verbatim )
00103 {
00104 
00105   #ifdef ErrorObjCONSTRUCTOR_TRACE
00106     std::cerr << "Copy Constructor for ErrorObj\n";
00107   #endif
00108 
00109 }  // ErrorObj(ErrorObj)

edm::ErrorObj::~ErrorObj (  )  [virtual]

Definition at line 112 of file ErrorObj.cc.

References TestMuL1L2Filter_cff::cerr.

00112                      {
00113 
00114   #ifdef ErrorObjCONSTRUCTOR_TRACE
00115     std::cerr << "Destructor for ErrorObj\n";
00116   #endif
00117 
00118 }  // ~ErrorObj()


Member Function Documentation

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

Definition at line 242 of file ErrorObj.cc.

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

Referenced by edm::service::ELadministrator::clearMsg(), ErrorObj(), edm::service::ELtsErrorLog::initiateMsg(), and set().

00242                       {
00243 
00244   mySerial     = 0;
00245   myXid.clear();
00246   myIdOverflow = "";
00247   myTimestamp  = 0;
00248   myItems.erase( myItems.begin(), myItems.end() );  // myItems.clear();
00249   myReactedTo  = false;
00250 
00251 }  // clear()

ELstring edm::ErrorObj::context (  )  const

Definition at line 133 of file ErrorObj.cc.

References myContext.

Referenced by edm::service::MessageLoggerScribe::log(), and edm::ELlog4cplus::log().

00133                                  {
00134   return myContext;
00135 }

ErrorObj & edm::ErrorObj::emit ( const ELstring txt  )  [virtual]

Definition at line 200 of file ErrorObj.cc.

References TestMuL1L2Filter_cff::cerr, edm::eq_nocase(), myItems, and setSubroutine().

Referenced by edm::service::ErrorLog::emit(), edm::service::ELtsErrorLog::item(), edm::service::ELerrorList::log(), and opltlt().

00200                                                {
00201 
00202   #ifdef ErrorObj_EMIT_TRACE
00203     std::cerr << "=:=:=: ErrorObj::emit ( " << s << " )\n";
00204   #endif
00205 
00206   #ifdef ErrorObj_SUB_TRACE
00207     if ( subN > 0 )  {
00208       std::cerr << "=:=:=: subN ErrorObj::emit ( " << s << " )\n";
00209       subN--;
00210     }
00211   #endif
00212 
00213   if ( eq_nocase(s.substr(0,5), "@SUB=" ) )  {
00214     #ifdef ErrorObj_SUB_TRACE
00215       std::cerr << "=:=:=: ErrorObj::@SUB s.substr(5) is: " << s.substr(5)
00216                 << '\n';
00217     #endif
00218     setSubroutine(s.substr(5));
00219   }
00220   else  {
00221     myItems.push_back( s );
00222   }
00223 
00224   return * this;
00225 
00226 }  // emit()

ELstring edm::ErrorObj::fullText (  )  const

Definition at line 137 of file ErrorObj.cc.

References it, myItems, and HLT_VtxMuL3::result.

00137                                    {
00138 
00139   ELstring result;
00140   for ( ELlist_string::const_iterator it = myItems.begin();
00141         it != myItems.end();
00142         ++it )
00143     result +=  *it;
00144   return result;
00145 
00146 }  // fullText()

const ELstring & edm::ErrorObj::idOverflow (  )  const

Definition at line 127 of file ErrorObj.cc.

References myIdOverflow.

Referenced by edm::service::ELoutput::log(), and edm::ELlog4cplus::log().

00127 { return myIdOverflow; }

bool edm::ErrorObj::is_verbatim (  )  const

Definition at line 131 of file ErrorObj.cc.

References verbatim.

Referenced by edm::service::ELoutput::log().

00131 { return verbatim; }

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

Definition at line 129 of file ErrorObj.cc.

References myItems.

Referenced by edm::service::ELfwkJobReport::log(), edm::service::ELoutput::log(), edm::service::ELcollected::log(), and edm::ELlog4cplus::log().

00129 { return myItems; }

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

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

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

Definition at line 254 of file ErrorObj.cc.

References emit(), emptyString, myOs, and verbatim.

00254                                   {
00255   // Exactly equivalent to the general template. 
00256   // If this is not provided explicitly, then the template will
00257   // be instantiated once for each length of string ever used.
00258   myOs.str(emptyString); 
00259   myOs << s;
00260 #ifdef OLD_STYLE_AUTOMATIC_SPACES
00261   if ( ! myOs.str().empty() ) {
00262     if ( !verbatim ) {
00263       emit( myOs.str() + ' ' );
00264     } else {
00265        emit( myOs.str() );
00266     }
00267   }
00268 #else
00269   if ( ! myOs.str().empty() ) emit( myOs.str() );
00270 #endif
00271   return *this;
00272 }

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

Referenced by edm::operator<<().

bool edm::ErrorObj::reactedTo (  )  const

Definition at line 130 of file ErrorObj.cc.

References myReactedTo.

Referenced by edm::service::ELstatistics::log().

00130 { return myReactedTo; }

int edm::ErrorObj::serial (  )  const

Definition at line 125 of file ErrorObj.cc.

References mySerial.

Referenced by edm::service::ELoutput::log(), and edm::ELlog4cplus::log().

00125 { return mySerial; }

void edm::ErrorObj::set ( const ELseverityLevel sev,
const ELstring id 
) [virtual]

Definition at line 229 of file ErrorObj.cc.

References clear(), mySerial, myTimestamp, ourSerial, setID(), and setSeverity().

Referenced by edm::service::ELtsErrorLog::initiateMsg(), and edm::service::ErrorLog::operator()().

00229                                                                       {
00230 
00231   clear();
00232 
00233   myTimestamp = time( 0 );
00234   mySerial = ++ ourSerial;
00235 
00236   setID( id );
00237   setSeverity( sev );
00238 
00239 }  // set()

void edm::ErrorObj::setContext ( const ELstring context  )  [virtual]

Definition at line 170 of file ErrorObj.cc.

References myContext.

Referenced by edm::MessageSender::~MessageSender().

00170 { myContext = c; }

void edm::ErrorObj::setID ( const ELstring ID  )  [virtual]

Definition at line 161 of file ErrorObj.cc.

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

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

00161                                            {
00162   myXid.id = ELstring( id, 0, maxIDlength );
00163   if ( id.length() > maxIDlength )
00164     myIdOverflow = ELstring( id, maxIDlength, id.length()-maxIDlength );
00165 }

void edm::ErrorObj::setModule ( const ELstring module  )  [virtual]

Definition at line 168 of file ErrorObj.cc.

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

Referenced by edm::service::ELtsErrorLog::initiateMsg(), edm::service::ErrorLog::operator()(), edm::service::ELtsErrorLog::pokeMsg(), and edm::MessageSender::~MessageSender().

00168 { myXid.module = module; }

void edm::ErrorObj::setProcess ( const ELstring proc  )  [virtual]

Definition at line 183 of file ErrorObj.cc.

References TestMuL1L2Filter_cff::cerr, myXid, and edm::ELextendedID::process.

Referenced by edm::service::ELtsErrorLog::initiateMsg(), edm::service::ErrorLog::operator()(), and edm::service::ELtsErrorLog::pokeMsg().

00183                                                   {
00184   myXid.process = proc;
00185   #if 0
00186     std::cerr << "ErrorObj process set to \"" << proc << "\"\n";
00187   #endif
00188 }

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

Definition at line 190 of file ErrorObj.cc.

References myReactedTo.

Referenced by edm::service::ELtsErrorLog::dispatch(), edm::service::ELadministrator::finishMsg(), edm::service::ELtsErrorLog::initiateMsg(), and edm::service::ErrorLog::operator()().

00190                                      {
00191   myReactedTo = r;
00192 }

void edm::ErrorObj::setSeverity ( const ELseverityLevel sev  )  [virtual]

Definition at line 153 of file ErrorObj.cc.

References edm::ELfatal, edm::ELhighestSeverity, edm::ELincidental, edm::ELzeroSeverity, myXid, and edm::ELextendedID::severity.

Referenced by set().

00153                                                          {
00154   myXid.severity = (sev <= ELzeroSeverity   ) ? (ELseverityLevel)ELincidental
00155                  : (sev >= ELhighestSeverity) ? (ELseverityLevel)ELfatal
00156                  :                              sev
00157                  ;
00158 }

void edm::ErrorObj::setSubroutine ( const ELstring subroutine  )  [virtual]

Definition at line 173 of file ErrorObj.cc.

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

Referenced by emit(), edm::service::ELtsErrorLog::initiateMsg(), edm::service::ErrorLog::operator()(), and edm::service::ELtsErrorLog::pokeMsg().

00173                                                            {
00174   #ifdef ErrorObj_SUB_TRACE
00175     std::cerr << "=:=:=: ErrorObj::setSubroutine(" << subroutine << ")\n";
00176   #endif
00177   myXid.subroutine = (subroutine[0] == ' ')
00178                    ? subroutine.substr(1)
00179                    : subroutine;
00180 }

time_t edm::ErrorObj::timestamp (  )  const

Definition at line 128 of file ErrorObj.cc.

References myTimestamp.

Referenced by edm::service::ELoutput::log(), and edm::ELlog4cplus::log().

00128 { return myTimestamp; }

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

Definition at line 126 of file ErrorObj.cc.

References myXid.

Referenced by edm::service::ELtsErrorLog::dispatch(), edm::service::ELadministrator::finishMsg(), edm::service::ELfwkJobReport::log(), edm::service::ELerrorList::log(), edm::service::ELoutput::log(), edm::service::MessageLoggerScribe::log(), edm::service::ELcollected::log(), edm::service::ELstatistics::log(), edm::ELlog4cplus::log(), edm::service::ErrorLog::operator()(), edm::service::ELtsErrorLog::pokeMsg(), and edm::MessageSender::~MessageSender().

00126 { return myXid; }


Member Data Documentation

std::string edm::ErrorObj::emptyString [private]

Definition at line 116 of file ErrorObj.h.

Referenced by opltlt().

ELstring edm::ErrorObj::myContext [private]

Definition at line 114 of file ErrorObj.h.

Referenced by context(), and setContext().

ELstring edm::ErrorObj::myIdOverflow [private]

Definition at line 110 of file ErrorObj.h.

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

ELlist_string edm::ErrorObj::myItems [private]

Definition at line 112 of file ErrorObj.h.

Referenced by clear(), emit(), fullText(), and items().

std::ostringstream edm::ErrorObj::myOs [private]

Definition at line 115 of file ErrorObj.h.

Referenced by opltlt().

bool edm::ErrorObj::myReactedTo [private]

Definition at line 113 of file ErrorObj.h.

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

int edm::ErrorObj::mySerial [private]

Definition at line 108 of file ErrorObj.h.

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

time_t edm::ErrorObj::myTimestamp [private]

Definition at line 111 of file ErrorObj.h.

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

ELextendedID edm::ErrorObj::myXid [private]

Definition at line 109 of file ErrorObj.h.

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

int edm::ErrorObj::ourSerial [static, private]

Definition at line 104 of file ErrorObj.h.

Referenced by set().

bool edm::ErrorObj::verbatim [private]

Definition at line 117 of file ErrorObj.h.

Referenced by is_verbatim(), and opltlt().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:40:40 2009 for CMSSW by  doxygen 1.5.4