Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include <cmath>
0002 #include <iomanip>
0003 #include <iostream>
0004 
0005 #include "FWCore/Framework/interface/Frameworkfwd.h"
0006 #include "FWCore/Framework/interface/MakerMacros.h"
0007 #include "FWCore/Framework/interface/global/EDAnalyzer.h"
0008 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0009 #include "FWCore/Utilities/interface/StreamID.h"
0010 
0011 namespace edmtest {
0012 
0013   class UnitTestClient_G : public edm::global::EDAnalyzer<> {
0014   public:
0015     explicit UnitTestClient_G(edm::ParameterSet const&) {}
0016 
0017     void analyze(edm::StreamID, edm::Event const&, edm::EventSetup const&) const override;
0018   };
0019 
0020   void UnitTestClient_G::analyze(edm::StreamID, edm::Event const&, edm::EventSetup const&) const {
0021     if (!edm::isMessageProcessingSetUp()) {
0022       std::cerr << "??? It appears that Message Processing is not Set Up???\n\n";
0023     }
0024 
0025     double d = M_PI;
0026     edm::LogWarning("cat_A") << "Test of std::setprecision(p):"
0027                              << " Pi with precision 12 is " << std::setprecision(12) << d;
0028 
0029     for (int i = 0; i < 10; ++i) {
0030       edm::LogInfo("cat_B") << "\t\tEmit Info level message " << i + 1;
0031     }
0032 
0033     for (int i = 0; i < 15; ++i) {
0034       edm::LogWarning("cat_C") << "\t\tEmit Warning level message " << i + 1;
0035     }
0036   }
0037 
0038 }  // namespace edmtest
0039 
0040 using edmtest::UnitTestClient_G;
0041 DEFINE_FWK_MODULE(UnitTestClient_G);