3 #if MESSAGEFACILITY_HEX_VERSION < 0x20300
4 #define ML_DEBUG // always enable debug
14 #include "fhiclcpp/ParameterSet.h"
15 #include "fhiclcpp/make_ParameterSet.h"
17 #include "messagefacility/MessageLogger/MessageLogger.h"
22 mf::SetApplicationName(
"anotherLogger");
24 mf::LogWarning(
"warn1 | warn2") <<
"Followed by a WARNING message.";
25 mf::LogDebug(
"debug") <<
"The debug message in the other thread";
33 std::ostringstream ss;
34 std::ifstream logfhicl(
"MessageFacility.cfg");
35 if (logfhicl.is_open())
37 std::stringstream fhiclstream;
38 fhiclstream << logfhicl.rdbuf();
39 ss << fhiclstream.str();
41 fhicl::ParameterSet pset;
42 std::string pstr(ss.str());
43 fhicl::make_ParameterSet(pstr, pset);
44 mf::StartMessageFacility(pset);
46 catch (std::exception& e)
48 std::cerr <<
"Catched\n"
54 mf::SetApplicationName(
"mftest");
70 for (
int i = 0; i < 2; ++i)
74 sprintf(buf,
"mftest-%d", i);
75 mf::SetApplicationName(buf);
78 mf::LogError(
"catError") <<
"Error information. " << i;
79 mf::LogWarning(
"catWarning") <<
"Warning information. " << i;
80 mf::LogInfo(
"catInfo") <<
"Info information. " << i;
81 #if MESSAGEFACILITY_HEX_VERSION < 0x20300
82 LOG_DEBUG(
"debug") <<
"DEBUG information. " << i;
84 MF_LOG_DEBUG(
"debug") <<
"DEBUG information. " << i;