Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-10-01 22:41:13

0001 #include "Utilities/StorageFactory/interface/StorageFactory.h"
0002 #include "Utilities/StorageFactory/interface/StorageAccount.h"
0003 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0004 #include "FWCore/MessageLogger/interface/MessageLoggerQ.h"
0005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0006 #include "FWCore/PluginManager/interface/PresenceFactory.h"
0007 #include "FWCore/PluginManager/interface/PluginManager.h"
0008 #include "FWCore/PluginManager/interface/standard.h"
0009 #include <iostream>
0010 #include <memory>
0011 
0012 static std::shared_ptr<edm::Presence> gobbleUpTheGoop;
0013 static void initTest(void) {
0014   // Initialise the plug-in manager.
0015   edmplugin::PluginManager::configure(edmplugin::standard::config());
0016 
0017   // Enable storage accounting
0018   edm::storage::StorageFactory::getToModify()->enableAccounting(true);
0019 
0020   // This interface sucks but does the job, which is to silence
0021   // the message logger chatter about "info" or "debug" messages,
0022   // and prevent the tests from hanging forever due to lack of a
0023   // logger.
0024   try {
0025     gobbleUpTheGoop =
0026         std::shared_ptr<edm::Presence>(edm::PresenceFactory::get()->makePresence("SingleThreadMSPresence").release());
0027   } catch (cms::Exception &e) {
0028     std::cerr << e.explainSelf() << std::endl;
0029   }
0030 
0031   const char *pset =
0032       "<destinations=-s({63657272})"                                  // cerr
0033       ";cerr=-P(<noTimeStamps=-B(true);threshold=-S(5741524e494e47)"  // WARNING
0034       ";WARNING=-P(<limit=-I(+0)>);default=-P(<limit=-I(-1)>)>)>";
0035   edm::MessageLoggerQ::MLqMOD(new std::string);
0036   edm::MessageLoggerQ::MLqCFG(new edm::ParameterSet(pset));
0037   edm::LogInfo("AvoidExitCrash") << "Message logger, please don't crash at exit if"
0038                                  << " nothing else worthwhile was printed. Thanks.";
0039 }