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