$treeview $search $mathjax $extrastylesheet
otsdaq
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #ifndef OTSDAQ_CORE_MESSAGEFACILITY_MESSAGEFACILITY_H 00002 #define OTSDAQ_CORE_MESSAGEFACILITY_MESSAGEFACILITY_H 00003 00004 #include <messagefacility/MessageLogger/MessageLogger.h> 00005 #include "artdaq-core/Utilities/configureMessageFacility.hh" 00006 #include "otsdaq-core/Macros/CoutMacros.h" 00007 00008 namespace ots 00009 { 00010 inline void INIT_MF(const char* name) 00011 { 00012 char* logRootString = getenv("OTSDAQ_LOG_ROOT"); 00013 if(logRootString == nullptr) 00014 { 00015 __COUT_ERR__ << "\n**********************************************************" 00016 << std::endl; 00017 __COUT_ERR__ << "WARNING: OTSDAQ_LOG_ROOT environment variable was not set!" 00018 << std::endl; 00019 __COUT_ERR__ << "**********************************************************\n" 00020 << std::endl; 00021 ; 00022 // exit(0); 00023 } 00024 else 00025 setenv("ARTDAQ_LOG_ROOT", logRootString, 1); 00026 00027 char* logFhiclCode = getenv("OTSDAQ_LOG_FHICL"); 00028 if(logFhiclCode == nullptr) 00029 { 00030 __COUT_ERR__ << "\n***********************************************************" 00031 << std::endl; 00032 __COUT_ERR__ << "WARNING: OTSDAQ_LOG_FHICL environment variable was not set!" 00033 << std::endl; 00034 __COUT_ERR__ << "***********************************************************\n" 00035 << std::endl; 00036 // exit(0); 00037 } 00038 else 00039 setenv("ARTDAQ_LOG_FHICL", logFhiclCode, 1); 00040 00041 __COUT__ << "Configuring message facility with " << logFhiclCode << __E__; 00042 artdaq::configureMessageFacility(name /*application name*/, 00043 false /*cout display*/, 00044 true /*enable debug messages*/); 00045 00046 artdaq::setMsgFacAppName(name, 0); 00047 } 00048 00049 } // namespace ots 00050 00051 #endif