CMS 3D CMS Logo

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

edm::service::ELcollected Class Reference

#include <ELcollected.h>

Inheritance diagram for edm::service::ELcollected:
edm::service::ELoutput edm::service::ELdestination

List of all members.

Public Member Functions

virtual ELcollectedclone () const
 ELcollected (const ELsender &sender)
 ELcollected (const ELcollected &orig)
 ELcollected (ELoutput *d)
virtual bool log (const edm::ErrorObj &msg)
virtual ~ELcollected ()

Protected Member Functions

void emitToken (const ELstring &s, bool nl=false)
void emitXid (const ELextendedID &xid)
void intoBuf (const ELstring &s)

Protected Attributes

ELstring buf
boost::shared_ptr< ELsendersender

Friends

class ELdestControl

Detailed Description

Definition at line 91 of file ELcollected.h.


Constructor & Destructor Documentation

edm::service::ELcollected::ELcollected ( const ELsender sender)

Definition at line 37 of file ELcollected.cc.

References gather_cfg::cout.

Referenced by clone().

: ELoutput()
, sender  ( snd.clone() )
{

  #ifdef ELcollectedCONSTRUCTOR_TRACE
    std::cout << "Constructor for ELcollected(ELsender)\n";
  #endif

  // Unlike ELoutput, we do not emit Error Log established message.

}  // ELcollected()
edm::service::ELcollected::ELcollected ( const ELcollected orig)

Definition at line 51 of file ELcollected.cc.

References gather_cfg::cout, edm::service::ELdestination::ignoreMostModules, edm::service::ELdestination::ignoreThese, edm::service::ELdestination::respondToMostModules, and edm::service::ELdestination::respondToThese.

: ELoutput( orig        )
, sender  ( orig.sender->clone() )              // $$ mf 9/15/00
{

  #ifdef ELcollectedCONSTRUCTOR_TRACE
    std::cout << "Copy constructor for ELcollected\n";
  #endif

  ignoreMostModules    = orig.ignoreMostModules;
  respondToThese       = orig.respondToThese;
  respondToMostModules = orig.respondToMostModules;
  ignoreThese          = orig.ignoreThese;

}  // ELcollected()
edm::service::ELcollected::ELcollected ( ELoutput d)
edm::service::ELcollected::~ELcollected ( ) [virtual]

Definition at line 68 of file ELcollected.cc.

References gather_cfg::cout.

                           {

  #ifdef ELcollectedCONSTRUCTOR_TRACE
    std::cout << "Destructor for ELcollected)\n";
  #endif
}  // ~ELcollected()

Member Function Documentation

ELcollected * edm::service::ELcollected::clone ( void  ) const [virtual]

Reimplemented from edm::service::ELoutput.

Definition at line 82 of file ELcollected.cc.

References ELcollected().

                          {

  return  new ELcollected( *this );

} // clone()
void edm::service::ELcollected::emitToken ( const ELstring s,
bool  nl = false 
) [protected, virtual]

Reimplemented from edm::service::ELoutput.

Definition at line 126 of file ELcollected.cc.

References edm::service::ELoutput::charsOnLine, gather_cfg::cout, intoBuf(), and edm::service::ELdestination::newline.

Referenced by log().

                                                          {

  #ifdef ELcollected_EMIT_TRACE
    std::cout << "[][][] in emit:  s.length() " << s.length() << "\n";
  #endif

  // A forced newline is something that needs to be transmitted.
  // We shall insert it as its own item.

  if (s.length() == 0)  {
    if ( nl )  {
      intoBuf( newline );
      charsOnLine = 0;
    }
    return;
  }

  // Setting up for indentation if you start with a nweline, or if the length
  // exceeds column 80, is not done here, it is done on the server.

  #ifdef ELcollected_EMIT_TRACE
    std::cout << "[][][] in emit: about to << s to buf: " << s << " \n";
  #endif

  // Place the item into the buffer

  intoBuf (s);

  // Accounting for trailing \n is done at the server.

  // A forced trailing newline is something that needs to be transmitted.
  // We shall insert it as its own item.

  if ( nl )  {
    intoBuf (newline);
  }

  #ifdef ELcollected_EMIT_TRACE
    std::cout << "[][][] in emit: completed \n";
  #endif

}  // emitToken()
void edm::service::ELcollected::emitXid ( const ELextendedID xid) [protected]

Definition at line 107 of file ELcollected.cc.

References buf, edm::ELseverityLevel::getLevel(), edm::ELextendedID::id, intoBuf(), edm::ELextendedID::module, edm::ELextendedID::process, edm::ELextendedID::severity, and edm::ELextendedID::subroutine.

Referenced by log().

                                                     {

  buf = "";

  intoBuf ( xid.process    );
  intoBuf ( xid.module     );
  intoBuf ( xid.subroutine );
  intoBuf ( xid.id         );
  std::ostringstream ost;
  ost << xid.severity.getLevel();
  intoBuf ( ost.str() );

} // emitXid
void edm::service::ELcollected::intoBuf ( const ELstring s) [protected]

Definition at line 95 of file ELcollected.cc.

References buf, and asciidump::s.

Referenced by emitToken(), and emitXid().

                                               {

  buf += s;
  buf += '\0';

} // intoBuf();
bool edm::service::ELcollected::log ( const edm::ErrorObj msg) [virtual]

Reimplemented from edm::service::ELoutput.

Definition at line 175 of file ELcollected.cc.

References edm::service::ELlimitsTable::add(), buf, gather_cfg::cout, emitToken(), emitXid(), edm::service::ELadministrator::instance(), edm::ErrorObj::items(), edm::service::ELdestination::limits, edm::ELextendedID::module, sender, edm::ELextendedID::severity, edm::service::ELdestination::thisShouldBeIgnored(), edm::service::ELdestination::threshold, edm::service::ELdestination::traceThreshold, edm::service::ELoutput::wantText, edm::service::ELoutput::xid, and edm::ErrorObj::xid().

                                                {

  #ifdef ELcollectedTRACE_LOG
    std::cout << "    =:=:=: Log to an ELcollected \n";
  #endif

  xid = msg.xid();      // Save the xid.

  // See if this message is to be acted upon, and add it to limits table
  // if it was not already present:
  //
  if ( msg.xid().severity < threshold  )  return false;
  if ( thisShouldBeIgnored(xid.module) )  return false;
  if ( ! limits.add( msg.xid() )      )   return false;

  #ifdef ELcollectedTRACE_LOG
    std::cout << "    =:=:=: Limits table work done \n";
  #endif

  // start the buffer with the xid

  emitXid (xid);

  //

  #ifdef ELcollectedTRACE_LOG
    std::cout << "    =:=:=: xid emitted \n";
  #endif

  // Provide the context information.  The server side will use this to prime
  // its special context supplier.  We will send over all three types of
  // context, even though probably only 1 or 2 will be needed.

  emitToken( ELadministrator::instance()->
                        getContextSupplier().summaryContext());
  emitToken( ELadministrator::instance()->
                        getContextSupplier().context());
  emitToken( ELadministrator::instance()->
                        getContextSupplier().fullContext());

  #ifdef ELcollectedTRACE_LOG
    std::cout << "    =:=:=: Context done: \n";
  #endif

  // No prologue separate from what the server will issue.

  // No serial number of message separate from what the server will issue.

  // collected each item in the message:
  //
  if ( wantText )  {
    ELlist_string::const_iterator it;
    for ( it = msg.items().begin();  it != msg.items().end();  ++it )  {
  #ifdef ELcollectedTRACE_LOG
    std::cout << "      =:=:=: Item:  " << *it <<"\n";
  #endif
      emitToken( *it );
    }
  }

  // DO NOT Provide further identification such as module and subroutine;
  // the server side will provide that using the xid you have sent it, if
  // the server side user wants it.

  // DO NOT provide time stamp; it would duplicate server's stamp!

  // Provide traceback information:
  //
  if ( msg.xid().severity >= traceThreshold )  {
    emitToken( ELstring("\n")
          + ELadministrator::instance()->getContextSupplier().traceRoutine()
        , true );
  }
  else  {                                        //else statement added JV:1
    emitToken( "", true );
  }
  #ifdef ELcollectedTRACE_LOG
    std::cout << "    =:=:=: Trace routine done: \n";
  #endif

  // Message has been fully processed through emit; now put in an extra
  // zero, and send out the buffer.
  //

  buf += char(0);
  int nbuf = buf.length();

  sender->send ( nbuf, buf.data() );

  #ifdef ELcollectedTRACE_LOG
    std::cout << "  =:=:=: log(msg) done: \n";
  #endif

  return true;

}  // log()

Friends And Related Function Documentation

friend class ELdestControl [friend]

Reimplemented from edm::service::ELoutput.

Definition at line 93 of file ELcollected.h.


Member Data Documentation

Definition at line 141 of file ELcollected.h.

Referenced by emitXid(), intoBuf(), and log().

boost::shared_ptr<ELsender> edm::service::ELcollected::sender [protected]

Definition at line 136 of file ELcollected.h.

Referenced by log().