10 #include "fhiclcpp/ParameterSet.h"
12 #include "messagefacility/MessageLogger/MessageLogger.h"
17 mf::SetApplicationName(
"anotherLogger");
19 mf::LogWarning(
"warn1 | warn2") <<
"Followed by a WARNING message.";
20 mf::LogDebug(
"debug") <<
"The debug message in the other thread";
28 std::ostringstream ss;
29 std::ifstream logfhicl(
"MessageFacility.cfg");
30 if (logfhicl.is_open())
32 std::stringstream fhiclstream;
33 fhiclstream << logfhicl.rdbuf();
34 ss << fhiclstream.str();
37 std::string pstr(ss.str());
38 fhicl::ParameterSet pset = fhicl::ParameterSet::make(pstr);
39 mf::StartMessageFacility(pset);
41 catch (std::exception& e)
43 std::cerr <<
"Catched\n"
49 mf::SetApplicationName(
"mftest");
65 for (
int i = 0; i < 2; ++i)
69 sprintf(buf,
"mftest-%d", i);
70 mf::SetApplicationName(buf);
73 mf::LogError(
"catError") <<
"Error information. " << i;
74 mf::LogWarning(
"catWarning") <<
"Warning information. " << i;
75 mf::LogInfo(
"catInfo") <<
"Info information. " << i;
77 MF_LOG_DEBUG(
"debug") <<
"DEBUG information. " << i;