3 #define MF_DEBUG // always enable debug 5 #include "boost/filesystem.hpp" 6 #include "boost/program_options.hpp" 16 namespace bpo = boost::program_options;
24 runModule(
string const& modulename)
30 <<
"TimeReport> Report activated\n" 31 "TimeReport> Report columns headings for events: " 32 "eventnum runnum timetaken\n" 33 "TimeReport> Report columns headings for modules: " 34 "eventnum runnum modulelabel modulename timetaken";
38 <<
"TimeReport> Time report complete in " << 0.0402123 <<
" seconds\n" 39 <<
" Time Summary: \n" 40 <<
" Min: " << 303 <<
"\n" 41 <<
" Max: " << 5555 <<
"\n" 42 <<
" Avg: " << 4000 <<
"\n";
47 <<
"run: 1 subRun: 2 event: 456 " << .0440404;
52 <<
"run: 1 subRun: 2 event: 456 " 53 <<
"someString " << modulename <<
" " << 0.04404;
54 mf::LogSystem(
"system"s) <<
"This would be a major problem, I guess.";
62 ostringstream descstr;
63 descstr <<
"\nELdestinationTester is a sample program that can be used\n" 64 <<
"to test how messages are logged using different destinations\n" 65 <<
"and configurations. This can be particularly helpful for\n" 66 <<
"users who wish to supply their own plugin destinations.\n\n" 67 <<
"The configuration file should look like\n" 70 <<
" destinations: {\n" 77 descstr <<
"Usage: " << boost::filesystem::path(argv[0]).filename().native()
78 <<
" -c <config-file> \n\n" 80 bpo::options_description
desc{descstr.str()};
81 desc.add_options()(
"config,c", bpo::value<string>(),
"Configuration file.")(
82 "help,h",
"produce help message");
83 bpo::variables_map vm;
85 bpo::store(bpo::parse_command_line(argc, argv,
desc), vm);
89 cerr <<
"Exception from command line processing in " << argv[0] <<
": " 93 if (vm.count(
"help")) {
97 if (!vm.count(
"config")) {
98 cerr <<
"ERROR: No configuration specified ( -c <config_file> )" <<
endl;
101 string const config_string = vm[
"config"].as<
string>();
109 cerr <<
"ERROR: Failed to create a parameter set from an input " 110 "configuration string with exception " 111 << e.what() <<
".\n";
112 cerr <<
" Input configuration string follows:\n" 113 <<
"------------------------------------" 114 <<
"------------------------------------" 116 cerr << config_string <<
"\n";
117 cerr <<
"------------------------------------" 118 <<
"------------------------------------" 128 cerr << e.what() <<
'\n';
132 cerr << e.
what() <<
'\n';
136 cerr << e.what() <<
'\n';
140 cerr <<
"Caught unknown exception from mf::StartMessageFacility\n";
148 <<
"MemoryCheck: module G4:g4run VSIZE 1030.34 0 RSS 357.043 0.628906"s;
150 <<
"MemoryCheck: module G4:g4run VSIZE 1030.34 0 RSS 357.25 0.199219"s;
152 <<
"MemoryCheck: module G4:g4run VSIZE 1030.34 5.2 RSS 357.453 0.1875"s;
154 linfo <<
" vint contains: "s;
155 vector<int> vint{1, 2, 5, 89, 3};
156 auto i =
begin(vint);
157 auto const e =
end(vint);
171 for (
int i = 0; i != 5; ++i) {
181 logPROBLEM <<
"clever way to ensure persistence of temporary object"s;
184 log <<
"second line."s;
186 runModule(
"module1"s);
187 runModule(
"module5"s);
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
void SetIteration(string const &val)
static ParameterSet make(intermediate_table const &tbl)
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
cet::coded_exception< errors::error, detail::translate > Exception
void StartMessageFacility(fhicl::ParameterSet const &pset, string const &applicationName)
T get(std::string const &key) const
MaybeLogger_< ELseverityLevel::ELsev_severe, false > LogSystem
char const * what() const noexcept override
#define MF_LOG_PROBLEM(category)
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
void SetModuleName(string const &val)
MaybeLogger_< ELseverityLevel::ELsev_severe, true > LogAbsolute
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)
int main(int argc, char *argv[])