1 #ifndef OTSDAQ_CORE_MESSAGEFACILITY_MESSAGEFACILITY_H
2 #define OTSDAQ_CORE_MESSAGEFACILITY_MESSAGEFACILITY_H
4 #include <messagefacility/MessageLogger/MessageLogger.h>
5 #include "artdaq-core/Utilities/configureMessageFacility.hh"
6 #include "otsdaq-core/Macros/CoutHeaderMacros.h"
11 inline void INIT_MF(
const char* name)
13 char* logRootString = getenv(
"OTSDAQ_LOG_ROOT");
14 if (logRootString ==
nullptr)
17 __COUT_ERR__ <<
"\n**********************************************************" << std::endl;
18 __COUT_ERR__ <<
"WARNING: OTSDAQ_LOG_ROOT environment variable was not set!" << std::endl;
19 __COUT_ERR__ <<
"**********************************************************\n" << std::endl;;
23 setenv(
"ARTDAQ_LOG_ROOT", logRootString, 1);
25 char* logFhiclCode = getenv(
"OTSDAQ_LOG_FHICL");
26 if (logFhiclCode ==
nullptr)
28 __COUT_ERR__ <<
"\n***********************************************************" << std::endl;
29 __COUT_ERR__ <<
"WARNING: OTSDAQ_LOG_FHICL environment variable was not set!" << std::endl;
30 __COUT_ERR__ <<
"***********************************************************\n" << std::endl;
34 setenv(
"ARTDAQ_LOG_FHICL", logFhiclCode, 1);
36 artdaq::configureMessageFacility(name,
true,
true);
37 artdaq::setMsgFacAppName(name,0);