1 #include <QtCore/QSettings>
2 #include <QtWidgets/QApplication>
4 #include "ErrorHandler/MsgAnalyzerDlg.h"
6 #include <fhiclcpp/make_ParameterSet.h>
7 #include <messagefacility/MessageLogger/MessageLogger.h>
10 using namespace novadaq::errorhandler;
15 std::cout <<
"MsgAnalyzer usage:\n"
16 <<
" -h, --help \tdisplay help message\n"
17 <<
" -c, --configuration [file]\tspecify the path and filename to the message analyzer conf file\n"
18 <<
" -l, --log [file] \tspecify the path and filename to the log (messagefacility) conf file\n";
21 int main(
int argc,
char* argv[])
23 QApplication app(argc, argv);
25 std::string cfg(
"msganalyzer.fcl");
26 std::string mf_cfg(
"msganalyzer_mf.fcl");
31 auto partenv = getenv(
"ARTDAQ_PARTITION_NUMBER");
32 if (partenv !=
nullptr)
34 partition = atoi(partenv);
39 for (
int i = 0; i < argc; ++i)
41 if (!strcmp(argv[i],
"-h") || !strcmp(argv[i],
"--help"))
47 if ((!strcmp(argv[i],
"-c") || !strcmp(argv[i],
"--configuration")) && i < argc - 1)
49 cfg = std::string(argv[i + 1]);
54 if ((!strcmp(argv[i],
"-l") || !strcmp(argv[i],
"--log")) && i < argc - 1)
56 mf_cfg = std::string(argv[i + 1]);
65 fhicl::ParameterSet pset;
68 cet::filepath_lookup_after1 lookup_policy(
"FHICL_FILE_PATH");
69 make_ParameterSet(mf_cfg, lookup_policy, pset);
71 catch (cet::exception
const& ex)
73 TLOG(TLVL_ERROR) <<
"Unable to load configuration file " << mf_cfg <<
": " << ex.explain_self();
76 mf::StartMessageFacility(pset,
"MsgAnalyzer");
78 mf::SetIteration(
"context");
79 mf::SetModuleName(
"module");
82 TLOG_DEBUG(
"category") <<
"DEBUG: MessageFacility service started";
83 TLOG_INFO(
"category") <<
"INFO: MessageFacility service started";
88 QSettings settings(
"artdaq",
"MsgAnalyzer");
89 dialog.restoreGeometry(settings.value(
"geometry").toByteArray());