CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/EventFilter/Message2log4cplus/src/MLlog4cplus.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     Services
00004 // Class  :     log4cplus
00005 // 
00006 //
00007 // Original Author:  Jim Kowalkowski
00008 // $Id: MLlog4cplus.cc,v 1.9 2008/01/22 18:49:59 muzaffar Exp $
00009 //
00010 
00011 #include "FWCore/MessageLogger/interface/MessageLoggerQ.h"
00012 #include "FWCore/MessageService/interface/NamedDestination.h"
00013 #include "EventFilter/Message2log4cplus/interface/ELlog4cplus.h"
00014 #include "EventFilter/Message2log4cplus/interface/MLlog4cplus.h"
00015 
00016 
00017 
00018 using namespace edm;
00019 
00020 
00021 using namespace ML;
00022 
00023   xdaq::Application *MLlog4cplus::appl_ = 0;
00024   MLlog4cplus::MLlog4cplus(const ParameterSet& iPS, ActivityRegistry&iRegistry)
00025   {
00026     // we may want these in the future, but probably not, since the
00027     // MessageLogger service is supposed to deal with that stuff anyway (JBK)
00028 
00029     // iRegistry.watchPostBeginJob(this,&MLlog4cplus::postBeginJob);
00030     // iRegistry.watchPostEndJob(this,&MLlog4cplus::postEndJob);
00031     
00032     // iRegistry.watchPreProcessEvent(this,&MLlog4cplus::preEventProcessing);
00033     // iRegistry.watchPostProcessEvent(this,&MLlog4cplus::postEventProcessing);
00034     
00035     // iRegistry.watchPreModule(this,&MLlog4cplus::preModule);
00036     // iRegistry.watchPostModule(this,&MLlog4cplus::postModule);
00037 
00038 
00039     // pseudo-code:
00040     // get message logger message queue (singleton)
00041     // make new ELlog4cplus object using parameterset set information
00042     // make a message with opcode NEWDEST
00043     // send message (NEWDEST,ELdest*)
00044 
00045 
00046     // we should first get a handle to the MessageLogger service to
00047     // ensure that it is initialized before we are (JBK)
00048     // edm::Service<edm::MessageLogger> handle;
00049 
00050     dest_p = new ELlog4cplus;
00051     dest_p->setAppl(appl_);
00052     edm::service::NamedDestination * ndest = new edm::service::NamedDestination ( "log4cplus", dest_p ); 
00053     edm::MessageLoggerQ::MLqEXT(ndest);
00054   }
00055 
00056 
00057   MLlog4cplus::~MLlog4cplus()
00058   {
00059   }
00060 
00061   void MLlog4cplus::postBeginJob()
00062   {
00063   }
00064 
00065   void MLlog4cplus::postEndJob()
00066   {
00067   }
00068 
00069   void MLlog4cplus::preEventProcessing(const edm::EventID& iID,
00070                                        const edm::Timestamp& iTime)
00071   {
00072   }
00073 
00074   void MLlog4cplus::postEventProcessing(const Event& e, const EventSetup&)
00075   {
00076   }
00077 
00078   void MLlog4cplus::preModule(const ModuleDescription&)
00079   {
00080   }
00081 
00082   void MLlog4cplus::postModule(const ModuleDescription& desc)
00083   {
00084   }
00085   void MLlog4cplus::setAppl(xdaq::Application *app)
00086   {
00087     appl_ = app;
00088   }