Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:12:48

0001 // UnitTestClient_B is used for testing LogStatistics and the reset behaviors
0002 // of statistics destinations.
0003 
0004 #include "FWCore/Framework/interface/Frameworkfwd.h"
0005 #include "FWCore/Framework/interface/MakerMacros.h"
0006 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0007 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0008 
0009 namespace edmtest {
0010 
0011   class UnitTestClient_B : public edm::one::EDAnalyzer<> {
0012   public:
0013     explicit UnitTestClient_B(edm::ParameterSet const&) {}
0014 
0015     void analyze(edm::Event const&, edm::EventSetup const&) override;
0016 
0017   private:
0018     int nevent = 0;
0019   };
0020 
0021   void UnitTestClient_B::analyze(edm::Event const&, edm::EventSetup const&) {
0022     nevent++;
0023     for (int i = 0; i < nevent; ++i) {
0024       edm::LogError("cat_A") << "LogError was used to send this message";
0025     }
0026     edm::LogError("cat_B") << "LogError was used to send this other message";
0027     edm::LogStatistics();
0028   }
0029 
0030 }  // namespace edmtest
0031 
0032 using edmtest::UnitTestClient_B;
0033 DEFINE_FWK_MODULE(UnitTestClient_B);