10 #include <framework/modules/core/ProgressModule.h>
11 #include <framework/logging/Logger.h>
20 m_output("Processed: %3d runs, %6d events")
22 setDescription(
"Periodically writes the number of processed events/runs to the"
23 " logging system to give a progress indication.\n"
24 "The output is logarithmic, meaning it will output the first 10 events, "
25 "then every tenth event up to 100, then every hundreth event up to 1000, etc. "
26 "Output cannot be suppressed using set_log_level. "
27 "If you don't want messages, you don't want this module");
28 addParam(
"maxN", m_maxOrder,
29 "At most, 10^N events will lie between outputs", m_maxOrder);
32 void ProgressModule::initialize()
35 setLogLevel(LogConfig::c_Info);
36 m_runNr = m_evtNr = 0;
39 void ProgressModule::beginRun()
42 B2INFO(
"Begin of new run");
45 void ProgressModule::event()
49 int order = (m_evtNr == 0) ? 1 : (
int)(min(log10(m_evtNr), (
double)m_maxOrder));
50 auto interval = (int)pow(10., order);
51 if (m_evtNr % interval == 0) B2INFO(m_output % m_runNr % m_evtNr);