CMS 3D CMS Logo

Public Member Functions | Public Attributes | Protected Attributes | Private Attributes | Friends

edm::service::ErrorLog Class Reference

#include <ErrorLog.h>

List of all members.

Public Member Functions

ErrorLogemitToken (const ELstring &msg)
ErrorLogendmsg ()
 ErrorLog ()
 ErrorLog (const ELstring &pkgName)
bool getELdestControl (const ELstring &name, ELdestControl &theDestControl) const
ELstring moduleName () const
ErrorLogoperator() (edm::ErrorObj &msg)
ErrorLogoperator() (const ELseverityLevel &sev, const ELstring &id)
ErrorLogoperator() (int debugLevel)
ErrorLogoperator() (int nbytes, char *data)
ErrorLogoperator<< (void(*f)(ErrorLog &))
void setDebugMessages (ELseverityLevel sev, ELstring id)
void setDebugVerbosity (int debugVerbosity)
ELseverityLevel setDiscardThreshold (ELseverityLevel sev)
int setHexTrigger (int trigger)
void setModule (const ELstring &modName)
void setPackage (const ELstring &pkgName)
bool setSpaceAfterInt (bool space=true)
void setSubroutine (const ELstring &subName)
ELstring subroutineName () const
virtual ~ErrorLog ()

Public Attributes

ELstring debugMessageId
ELseverityLevel debugSeverityLevel
int debugVerbosityLevel
bool discarding
ELseverityLevel discardThreshold
int hexTrigger
bool spaceAfterInt

Protected Attributes

ELadministratora

Private Attributes

ELstring module
ELstring subroutine

Friends

class ELtsErrorLog

Detailed Description

Definition at line 51 of file ErrorLog.h.


Constructor & Destructor Documentation

edm::service::ErrorLog::ErrorLog ( )

Definition at line 69 of file ErrorLog.cc.

References gather_cfg::cout.

: a( ELadministrator::instance() )
, subroutine( "" )
, module( "" )
, hexTrigger(-1)
, spaceAfterInt(false)
, discardThreshold (ELzeroSeverity)
, discarding (false)
, debugVerbosityLevel(0)
, debugSeverityLevel(ELinfo)
, debugMessageId ("DEBUG")
{

  #ifdef ErrorLogCONSTRUCTOR_TRACE
    std::cout << "Constructor for ErrorLog\n";
  #endif

}  // ErrorLog()
edm::service::ErrorLog::ErrorLog ( const ELstring pkgName)

Definition at line 88 of file ErrorLog.cc.

References gather_cfg::cout.

: a( ELadministrator::instance() )
, subroutine( "" )
, module( pkgName )
, hexTrigger(-1)
, spaceAfterInt(false)
, discardThreshold (ELzeroSeverity)
, discarding (false)
, debugVerbosityLevel(0)
, debugSeverityLevel(ELinfo)
, debugMessageId ("DEBUG")
{

  #ifdef ErrorLogCONSTRUCTOR_TRACE
    std::cout << "Constructor for ErrorLog (with pkgName = " << pkgName << ")\n";
  #endif

}  // ErrorLog()
edm::service::ErrorLog::~ErrorLog ( ) [virtual]

Definition at line 108 of file ErrorLog.cc.

References gather_cfg::cout.

                     {

  #ifdef ErrorLogCONSTRUCTOR_TRACE
    std::cout << "Destructor for ErrorLog\n";
  #endif

}  // ~ErrorLog()

Member Function Documentation

ErrorLog & edm::service::ErrorLog::emitToken ( const ELstring msg)

Definition at line 269 of file ErrorLog.cc.

References a, gather_cfg::cout, edm::ELunspecified, edm::ErrorObj::emitToken(), edm::service::ELadministrator::msg, and edm::service::ELadministrator::msgIsActive.

Referenced by edm::service::operator<<().

                                                    {

  #ifdef ErrorLogEMIT_TRACE
    std::cout << " =:=:=: ErrorLog emit trace:  string is: " << s << "\n";
  #endif

  if ( ! a->msgIsActive )
    (*this) ( ELunspecified, "..." );

  a->msg.emitToken( s );

  #ifdef ErrorLogEMIT_TRACE
    std::cout << " =:=:=: ErrorLog emit trace:  return from a->msg.emitToken()\n";
  #endif

  return  *this;

}  // emitToken()
ErrorLog & edm::service::ErrorLog::endmsg ( )

Definition at line 289 of file ErrorLog.cc.

References a, edm::service::ELadministrator::clearMsg(), gather_cfg::cout, edm::service::ELadministrator::finishMsg(), and edm::service::ELadministrator::msgIsActive.

Referenced by edm::service::endmsg(), and operator()().

                             {

  #ifdef ErrorLogENDMSG_TRACE
    std::cout << "=:=:=: endmsg () -- msgIsActive = " << a->msgIsActive
              << std::endl;
  #endif

  if ( a->msgIsActive )  {
    #ifdef ErrorLogENDMSG_TRACE
      std::cout << "=:=:=: endmsg () -- finishMsg started\n";
    #endif
    a->finishMsg();
    #ifdef ErrorLogENDMSG_TRACE
      std::cout << "=:=:=: endmsg () -- finishMsg completed\n";
    #endif
      a->clearMsg();
    }
    return  *this;

}  // endmsg()
bool edm::service::ErrorLog::getELdestControl ( const ELstring name,
ELdestControl theDestControl 
) const

Definition at line 341 of file ErrorLog.cc.

References a, and edm::service::ELadministrator::getELdestControl().

                                                                             {
  return a->getELdestControl(name, theDestControl);
}
ELstring edm::service::ErrorLog::moduleName ( ) const

Definition at line 350 of file ErrorLog.cc.

References module.

{ return module; }
ErrorLog & edm::service::ErrorLog::operator() ( edm::ErrorObj msg)

Definition at line 180 of file ErrorLog.cc.

References a, edm::service::ELadministrator::abortThreshold(), edm::service::ELadministrator::attach(), benchmark_cfg::cerr, edm::service::ELadministrator::context_, gather_cfg::cout, endmsg(), edm::service::ELadministrator::exitThreshold(), edm::ELseverityLevel::getLevel(), edm::service::ELadministrator::highSeverity_, edm::ELextendedID::module, edm::service::possiblyAbOrEx(), edm::service::ELadministrator::process(), edm::ELextendedID::process, edm::ErrorObj::setModule(), edm::ErrorObj::setProcess(), edm::ErrorObj::setReactedTo(), edm::ErrorObj::setSubroutine(), edm::ELextendedID::severity, edm::service::ELadministrator::severityCounts_, edm::service::ELadministrator::sinks(), subroutine, edm::ELextendedID::subroutine, and edm::ErrorObj::xid().

                                                    {

  #ifdef ErrorLogENDMSG_TRACE
    std::cout << "=:=:=: precautionary endmsg called from operator() (msg) \n";
  #endif

  endmsg();  // precautionary

  // -----  will we need to poke/restore info into the message?
  //
  bool updateProcess   ( msg.xid().process   .length() == 0 );
  bool updateModule    ( msg.xid().module    .length() == 0 );
  bool updateSubroutine( msg.xid().subroutine.length() == 0 );

  // -----  poke, if needed:
  //
  if ( updateProcess    )  msg.setProcess   ( a->process() );
  if ( updateModule     )  msg.setModule    ( module );
  if ( updateSubroutine )  msg.setSubroutine( subroutine );

  // severity level statistics keeping:                 // $$ mf 6/7/01
  int lev = msg.xid().severity.getLevel();
  ++ a->severityCounts_[lev];
  if ( lev > a->highSeverity_.getLevel() )
    a->highSeverity_ = msg.xid().severity;

  a->context_->editErrorObj( msg );

  // -----  send the message to each destination:
  //
  if (a->sinks().begin() == a->sinks().end())  {
    std::cerr << "\nERROR LOGGED WITHOUT DESTINATION!\n";
    std::cerr << "Attaching destination \"cerr\" to ELadministrator by default\n"
              << std::endl;
    a->attach(ELoutput(std::cerr));
  }
  std::list<boost::shared_ptr<ELdestination> >::iterator d;
  for ( d = a->sinks().begin();  d != a->sinks().end();  ++d )
    if (  (*d)->log( msg )  )
      msg.setReactedTo ( true );

  possiblyAbOrEx ( msg.xid().severity.getLevel(),
                   a->abortThreshold().getLevel(),
                   a->exitThreshold().getLevel()   );   // $$ mf 3/17/04

  // -----  restore, if we poked above:
  //
  if ( updateProcess    )  msg.setProcess( "" );
  if ( updateModule     )  msg.setModule( "" );
  if ( updateSubroutine )  msg.setSubroutine( "" );

  return  *this;

}  // operator()( )
ErrorLog & edm::service::ErrorLog::operator() ( const ELseverityLevel sev,
const ELstring id 
)

Definition at line 116 of file ErrorLog.cc.

References a, gather_cfg::cout, discarding, discardThreshold, endmsg(), edm::ELseverityLevel::getName(), edm::service::ELadministrator::msg, edm::service::ELadministrator::msgIsActive, edm::service::ELadministrator::process(), edm::ErrorObj::set(), edm::ErrorObj::setModule(), edm::ErrorObj::setProcess(), edm::ErrorObj::setReactedTo(), edm::ErrorObj::setSubroutine(), and subroutine.

{

  if ( sev < discardThreshold ) {
    discarding = true;
    return *this;
  }

  discarding = false;

  #ifdef ErrorLogENDMSG_TRACE
    std::cout << "=:=:=: precautionary endmsg ( "
              << sev.getName() << ", " << id << ")\n";
  #endif

  endmsg();  // precautionary

  // -----  form ErrorObj for this new message:
  //
  a->msgIsActive = true;
  a->msg.set          ( sev, id );
  a->msg.setProcess   ( a->process() );
  a->msg.setModule    ( module );
  a->msg.setSubroutine( subroutine );
  a->msg.setReactedTo ( false );

  return  *this;

}  // operator()( sev, id )
ErrorLog& edm::service::ErrorLog::operator() ( int  debugLevel) [inline]
ErrorLog & edm::service::ErrorLog::operator() ( int  nbytes,
char *  data 
)

Definition at line 250 of file ErrorLog.cc.

References edm::service::ELrecv().

                                                         {

  ELrecv ( nbytes, data, module );
  return  *this;

}  // operator() (nbytes, data)
ErrorLog & edm::service::ErrorLog::operator<< ( void(*)(ErrorLog &)  f)

Definition at line 257 of file ErrorLog.cc.

References gather_cfg::cout, discarding, and f.

                                                         {
  #ifdef ErrorLogOUTPUT_TRACE
    std::cout << "=:=:=: ErrorLog output trace:  f at " << std::hex << f
              << std::endl;
  #endif
  if (discarding) return *this;
  f( *this );
  return  *this;

}  // operator<<()
void edm::service::ErrorLog::setDebugMessages ( ELseverityLevel  sev,
ELstring  id 
)

Definition at line 336 of file ErrorLog.cc.

References debugMessageId, and debugSeverityLevel.

Referenced by edm::service::ELtsErrorLog::setDebugMessages().

void edm::service::ErrorLog::setDebugVerbosity ( int  debugVerbosity)
ELseverityLevel edm::service::ErrorLog::setDiscardThreshold ( ELseverityLevel  sev)

Definition at line 326 of file ErrorLog.cc.

References discardThreshold.

Referenced by edm::service::ELtsErrorLog::setDiscardThreshold().

                                                                  {
  ELseverityLevel oldSev = discardThreshold;
  discardThreshold = sev;
  return oldSev;
}
int edm::service::ErrorLog::setHexTrigger ( int  trigger)

Definition at line 320 of file ErrorLog.cc.

References hexTrigger.

Referenced by edm::service::ELtsErrorLog::setHexTrigger().

                                        {
  int oldTrigger = hexTrigger;
  hexTrigger = trigger;
  return oldTrigger;
}
void edm::service::ErrorLog::setModule ( const ELstring modName)
void edm::service::ErrorLog::setPackage ( const ELstring pkgName)

Definition at line 243 of file ErrorLog.cc.

References setModule().

                                                     {

  setModule( pkgName );

}  // setPackage()
bool edm::service::ErrorLog::setSpaceAfterInt ( bool  space = true)

Definition at line 314 of file ErrorLog.cc.

References spaceAfterInt, and cond::rpcobtemp::temp.

                                          {
  bool temp = spaceAfterInt;
  spaceAfterInt = space;
  return temp;
}
void edm::service::ErrorLog::setSubroutine ( const ELstring subName)

Definition at line 149 of file ErrorLog.cc.

References subroutine.

Referenced by edm::service::ELrecv(), and edm::service::ELtsErrorLog::setSubroutine().

                                                        {

  subroutine = subName;

}  // setSubroutine()
ELstring edm::service::ErrorLog::subroutineName ( ) const

Definition at line 351 of file ErrorLog.cc.

References subroutine.

{ return subroutine; }

Friends And Related Function Documentation

friend class ELtsErrorLog [friend]

Definition at line 53 of file ErrorLog.h.


Member Data Documentation

Definition at line 121 of file ErrorLog.h.

Referenced by emitToken(), endmsg(), getELdestControl(), and operator()().

Definition at line 133 of file ErrorLog.h.

Referenced by setDebugMessages().

Definition at line 132 of file ErrorLog.h.

Referenced by setDebugMessages().

Definition at line 131 of file ErrorLog.h.

Referenced by setDebugVerbosity().

Definition at line 128 of file ErrorLog.h.

Referenced by edm::service::operator<<(), and setSpaceAfterInt().