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/CoutMacros.h"
10 inline void INIT_MF(
const char* name)
12 char* logRootString = getenv(
"OTSDAQ_LOG_ROOT");
13 if(logRootString ==
nullptr)
15 __COUT_ERR__ <<
"\n**********************************************************"
17 __COUT_ERR__ <<
"WARNING: OTSDAQ_LOG_ROOT environment variable was not set!"
19 __COUT_ERR__ <<
"**********************************************************\n"
25 setenv(
"ARTDAQ_LOG_ROOT", logRootString, 1);
27 char* logFhiclCode = getenv(
"OTSDAQ_LOG_FHICL");
28 if(logFhiclCode ==
nullptr)
30 __COUT_ERR__ <<
"\n***********************************************************"
32 __COUT_ERR__ <<
"WARNING: OTSDAQ_LOG_FHICL environment variable was not set!"
34 __COUT_ERR__ <<
"***********************************************************\n"
39 setenv(
"ARTDAQ_LOG_FHICL", logFhiclCode, 1);
41 __COUT__ <<
"Configuring message facility with " << logFhiclCode << __E__;
42 artdaq::configureMessageFacility(name ,
46 artdaq::setMsgFacAppName(name, 0);