Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
art
art
Framework
Core
detail
issue_reports.cc
Go to the documentation of this file.
1
#include "
art/Framework/Core/detail/issue_reports.h
"
2
#include "
canvas/Persistency/Provenance/EventID.h
"
3
#include "
messagefacility/MessageLogger/MessageLogger.h
"
4
5
#include <ctime>
6
#include <string>
7
8
namespace
{
9
std::string
const
st{
"st"
};
10
std::string
const
nd{
"nd"
};
11
std::string
const
rd{
"rd"
};
12
std::string
const
th{
"th"
};
13
14
std::string
const
&
15
suffix(
unsigned
const
count
)
16
{
17
// *0, *4 - *9 use "th".
18
unsigned
const
lastDigit = count % 10;
19
if
(lastDigit >= 4 || lastDigit == 0)
20
return
th;
21
// *11, *12, or *13 use "th".
22
if
(count % 100 - lastDigit == 10)
23
return
th;
24
return
(lastDigit == 1 ? st : (lastDigit == 2 ? nd : rd));
25
}
26
}
// namespace
27
28
void
29
art::detail::issue_reports
(
unsigned
const
count,
EventID
const
&
id
)
30
{
31
time_t
t
=
time
(0);
32
constexpr
char
tsOutput[] =
"dd-Mon-yyyy hh:mm:ss TZN "
;
33
constexpr
size_t
tsmax = (
sizeof
tsOutput) + 1;
34
char
ts[tsmax];
35
strftime(ts, tsmax,
"%d-%b-%Y %H:%M:%S %Z"
, localtime(&t));
36
mf::LogVerbatim
{
"ArtReport"
} <<
"Begin processing the "
<< count
37
<< suffix(count) <<
" record. "
<<
id
<<
" at "
38
<< ts;
39
// At some point we may want to initiate checkpointing here
40
}
issue_reports.h
EventID.h
mf::MaybeLogger_
Definition:
MessageLogger.h:113
string
std::string string
Definition:
nybbler.cc:12
MessageLogger.h
art::detail::issue_reports
void issue_reports(unsigned count, EventID const &id)
Definition:
issue_reports.cc:29
time
reco_momentum_tuples.t
t
Definition:
reco_momentum_tuples.py:25
reco_momentum_tuples.count
int count
Definition:
reco_momentum_tuples.py:202
art::EventID
Definition:
EventID.h:20
Generated by
1.8.11