FWCore
MessageLogger
src
ELseverityLevel.cc
Go to the documentation of this file.
1
// ----------------------------------------------------------------------
2
//
3
// ELseverityLevel.cc - implement objects that encode a message's urgency
4
//
5
// Both frameworker and user will often pass one of the
6
// instantiated severity levels to logger methods.
7
//
8
// The only other methods of ELseverityLevel a frameworker
9
// might use is to check the relative level of two severities
10
// using operator<() or the like.
11
//
12
// ----------------------------------------------------------------------
13
14
#include <cassert>
15
#include <ostream>
16
17
#include "
FWCore/MessageLogger/interface/ELseverityLevel.h
"
18
#include "
FWCore/MessageLogger/interface/ELmap.h
"
19
20
namespace
{
21
22
// ----------------------------------------------------------------------
23
// Helper to construct the string->ELsev_ map on demand:
24
// ----------------------------------------------------------------------
25
26
typedef
std::map<std::string const, edm::ELseverityLevel::ELsev_, std::less<>> ELmap;
27
28
ELmap
const
& loadMap() {
29
static
const
ELmap
m
= {{
edm::ELzeroSeverity
.
getSymbol
(),
edm::ELseverityLevel::ELsev_zeroSeverity
},
30
{
edm::ELzeroSeverity
.
getName
(),
edm::ELseverityLevel::ELsev_zeroSeverity
},
31
{
edm::ELzeroSeverity
.
getInputStr
(),
edm::ELseverityLevel::ELsev_zeroSeverity
},
32
{
edm::ELzeroSeverity
.
getVarName
(),
edm::ELseverityLevel::ELsev_zeroSeverity
},
33
{
edm::ELdebug
.
getSymbol
(),
edm::ELseverityLevel::ELsev_success
},
34
{
edm::ELdebug
.
getName
(),
edm::ELseverityLevel::ELsev_success
},
35
{
edm::ELdebug
.
getInputStr
(),
edm::ELseverityLevel::ELsev_success
},
36
{
edm::ELdebug
.
getVarName
(),
edm::ELseverityLevel::ELsev_success
},
37
{
edm::ELinfo
.
getSymbol
(),
edm::ELseverityLevel::ELsev_info
},
38
{
edm::ELinfo
.
getName
(),
edm::ELseverityLevel::ELsev_info
},
39
{
edm::ELinfo
.
getInputStr
(),
edm::ELseverityLevel::ELsev_info
},
40
{
edm::ELinfo
.
getVarName
(),
edm::ELseverityLevel::ELsev_info
},
41
{
edm::ELfwkInfo
.
getSymbol
(),
edm::ELseverityLevel::ELsev_fwkInfo
},
42
{
edm::ELfwkInfo
.
getName
(),
edm::ELseverityLevel::ELsev_fwkInfo
},
43
{
edm::ELfwkInfo
.
getInputStr
(),
edm::ELseverityLevel::ELsev_fwkInfo
},
44
{
edm::ELfwkInfo
.
getVarName
(),
edm::ELseverityLevel::ELsev_fwkInfo
},
45
{
edm::ELwarning
.
getSymbol
(),
edm::ELseverityLevel::ELsev_warning
},
46
{
edm::ELwarning
.
getName
(),
edm::ELseverityLevel::ELsev_warning
},
47
{
edm::ELwarning
.
getInputStr
(),
edm::ELseverityLevel::ELsev_warning
},
48
{
edm::ELwarning
.
getVarName
(),
edm::ELseverityLevel::ELsev_warning
},
49
{
edm::ELerror
.
getSymbol
(),
edm::ELseverityLevel::ELsev_error
},
50
{
edm::ELerror
.
getName
(),
edm::ELseverityLevel::ELsev_error
},
51
{
edm::ELerror
.
getInputStr
(),
edm::ELseverityLevel::ELsev_error
},
52
{
edm::ELerror
.
getVarName
(),
edm::ELseverityLevel::ELsev_error
},
53
{
edm::ELunspecified
.
getSymbol
(),
edm::ELseverityLevel::ELsev_unspecified
},
54
{
edm::ELunspecified
.
getName
(),
edm::ELseverityLevel::ELsev_unspecified
},
55
{
edm::ELunspecified
.
getInputStr
(),
edm::ELseverityLevel::ELsev_unspecified
},
56
{
edm::ELunspecified
.
getVarName
(),
edm::ELseverityLevel::ELsev_unspecified
},
57
{
edm::ELsevere
.
getSymbol
(),
edm::ELseverityLevel::ELsev_severe
},
58
{
edm::ELsevere
.
getName
(),
edm::ELseverityLevel::ELsev_severe
},
59
{
edm::ELsevere
.
getInputStr
(),
edm::ELseverityLevel::ELsev_severe
},
60
{
edm::ELsevere
.
getVarName
(),
edm::ELseverityLevel::ELsev_severe
},
61
{
edm::ELhighestSeverity
.
getSymbol
(),
edm::ELseverityLevel::ELsev_highestSeverity
},
62
{
edm::ELhighestSeverity
.
getName
(),
edm::ELseverityLevel::ELsev_highestSeverity
},
63
{
edm::ELhighestSeverity
.
getInputStr
(),
edm::ELseverityLevel::ELsev_highestSeverity
},
64
{
edm::ELhighestSeverity
.
getVarName
(),
edm::ELseverityLevel::ELsev_highestSeverity
}};
65
66
return
m
;
67
}
68
}
// namespace
69
70
namespace
edm
{
71
// ----------------------------------------------------------------------
72
// Birth/death:
73
// ----------------------------------------------------------------------
74
75
ELseverityLevel::ELseverityLevel
(std::string_view
s
) {
76
static
ELmap
const
&
m
= loadMap();
77
78
ELmap::const_iterator
i
=
m
.find(
s
);
79
myLevel
= (
i
==
m
.end()) ?
ELsev_unspecified
:
i
->second;
80
}
81
82
// ----------------------------------------------------------------------
83
// Accessors:
84
// ----------------------------------------------------------------------
85
86
const
std::string
&
ELseverityLevel::getSymbol
()
const
{
87
static
const
auto
symbols
= []() {
88
std::array<std::string, nLevels>
ret
;
89
ret
[
ELsev_noValueAssigned
] =
"0"
;
90
ret
[
ELsev_zeroSeverity
] =
"--"
;
91
ret
[
ELsev_success
] =
"-d"
;
92
ret
[
ELsev_info
] =
"-i"
;
93
ret
[
ELsev_fwkInfo
] =
"-f"
;
94
ret
[
ELsev_warning
] =
"-w"
;
95
ret
[
ELsev_error
] =
"-e"
;
96
ret
[
ELsev_unspecified
] =
"??"
;
97
ret
[
ELsev_severe
] =
"-s"
;
98
ret
[
ELsev_highestSeverity
] =
"!!"
;
99
return
ret
;
100
}();
101
102
assert
(
myLevel
<
nLevels
);
103
return
symbols
[
myLevel
];
104
}
105
106
const
std::string
&
ELseverityLevel::getName
()
const
{
107
static
const
auto
names
= []() {
108
std::array<std::string, nLevels>
ret
;
109
ret
[
ELsev_noValueAssigned
] =
"?no value?"
;
110
ret
[
ELsev_zeroSeverity
] =
"--"
;
111
ret
[
ELsev_success
] =
"Debug"
;
112
ret
[
ELsev_info
] =
"Info"
;
113
ret
[
ELsev_fwkInfo
] =
"FwkInfo"
;
114
ret
[
ELsev_warning
] =
"Warning"
;
115
ret
[
ELsev_error
] =
"Error"
;
116
ret
[
ELsev_unspecified
] =
"??"
;
117
ret
[
ELsev_severe
] =
"System"
;
118
ret
[
ELsev_highestSeverity
] =
"!!"
;
119
return
ret
;
120
}();
121
122
assert
(
myLevel
<
nLevels
);
123
return
names
[
myLevel
];
124
}
125
126
const
std::string
&
ELseverityLevel::getInputStr
()
const
{
127
static
const
auto
inputs
= []() {
128
std::array<std::string, nLevels>
ret
;
129
ret
[
ELsev_noValueAssigned
] =
"?no value?"
;
130
ret
[
ELsev_zeroSeverity
] =
"ZERO"
;
131
ret
[
ELsev_success
] =
"DEBUG"
;
132
ret
[
ELsev_info
] =
"INFO"
;
133
ret
[
ELsev_fwkInfo
] =
"FWKINFO"
;
134
ret
[
ELsev_warning
] =
"WARNING"
;
135
ret
[
ELsev_error
] =
"ERROR"
;
136
ret
[
ELsev_unspecified
] =
"UNSPECIFIED"
;
137
ret
[
ELsev_severe
] =
"SYSTEM"
;
138
ret
[
ELsev_highestSeverity
] =
"HIGHEST"
;
139
return
ret
;
140
}();
141
142
assert
(
myLevel
<
nLevels
);
143
return
inputs
[
myLevel
];
144
}
145
146
const
std::string
&
ELseverityLevel::getVarName
()
const
{
147
static
const
auto
varNames
= []() {
148
std::array<std::string, nLevels>
ret
;
149
ret
[
ELsev_noValueAssigned
] =
"?no value?"
;
150
ret
[
ELsev_zeroSeverity
] =
"ELzeroSeverity "
;
151
ret
[
ELsev_success
] =
"ELdebug "
;
152
ret
[
ELsev_info
] =
"ELinfo "
;
153
ret
[
ELsev_fwkInfo
] =
"ELfwkInfo "
;
154
ret
[
ELsev_warning
] =
"ELwarning "
;
155
ret
[
ELsev_error
] =
"ELerror "
;
156
ret
[
ELsev_unspecified
] =
"ELunspecified "
;
157
ret
[
ELsev_severe
] =
"ELsystem "
;
158
ret
[
ELsev_highestSeverity
] =
"ELhighestSeverity"
;
159
return
ret
;
160
}();
161
162
assert
(
myLevel
<
nLevels
);
163
return
varNames
[
myLevel
];
164
}
165
166
// ----------------------------------------------------------------------
167
// Emitter:
168
// ----------------------------------------------------------------------
169
170
std::ostream&
operator<<
(std::ostream& os,
const
ELseverityLevel
& sev) {
return
os <<
" -"
<< sev.
getName
() <<
"- "
; }
171
172
}
// end of namespace edm */
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition:
runTheMatrix.py:373
edm::ELseverityLevel::ELsev_highestSeverity
Definition:
ELseverityLevel.h:50
edm::ELseverityLevel::ELsev_zeroSeverity
Definition:
ELseverityLevel.h:34
mps_fire.i
i
Definition:
mps_fire.py:428
edm::ELhighestSeverity
constexpr const ELseverityLevel ELhighestSeverity
Definition:
ELseverityLevel.h:108
edm::ELinfo
constexpr const ELseverityLevel ELinfo
Definition:
ELseverityLevel.h:96
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::ELwarning
constexpr const ELseverityLevel ELwarning
Definition:
ELseverityLevel.h:100
cms::cuda::assert
assert(be >=bs)
edm::ELunspecified
constexpr const ELseverityLevel ELunspecified
Definition:
ELseverityLevel.h:104
edm::ELseverityLevel::getSymbol
const std::string & getSymbol() const
Definition:
ELseverityLevel.cc:86
edm::ELseverityLevel::ELsev_fwkInfo
Definition:
ELseverityLevel.h:40
edm::ELseverityLevel::ELsev_severe
Definition:
ELseverityLevel.h:48
edm::operator<<
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
Definition:
HLTGlobalStatus.h:106
alignCSCRings.s
s
Definition:
alignCSCRings.py:92
names
const std::string names[nVars_]
Definition:
PhotonIDValueMapProducer.cc:124
edm::ELseverityLevel::getInputStr
const std::string & getInputStr() const
Definition:
ELseverityLevel.cc:126
visualization-live-secondInstance_cfg.m
m
Definition:
visualization-live-secondInstance_cfg.py:72
edm::ELerror
constexpr const ELseverityLevel ELerror
Definition:
ELseverityLevel.h:102
edm::ELseverityLevel::ELsev_error
Definition:
ELseverityLevel.h:44
edm::ELseverityLevel::ELsev_unspecified
Definition:
ELseverityLevel.h:46
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
ELmap.h
edm::ELseverityLevel::ELsev_warning
Definition:
ELseverityLevel.h:42
edm::ELsevere
constexpr const ELseverityLevel ELsevere
Definition:
ELseverityLevel.h:106
edm::ELseverityLevel::nLevels
Definition:
ELseverityLevel.h:53
PixelMapPlotter.inputs
inputs
Definition:
PixelMapPlotter.py:490
edm::ELseverityLevel::ELsev_success
Definition:
ELseverityLevel.h:36
ELseverityLevel.h
edm::ELdebug
constexpr const ELseverityLevel ELdebug
Definition:
ELseverityLevel.h:94
edm::ELseverityLevel
Definition:
ELseverityLevel.h:26
edm::ELseverityLevel::ELsev_noValueAssigned
Definition:
ELseverityLevel.h:32
edm::ELseverityLevel::getName
const std::string & getName() const
Definition:
ELseverityLevel.cc:106
edm::ELseverityLevel::myLevel
int myLevel
Definition:
ELseverityLevel.h:83
varNames
constexpr const char * varNames[]
Definition:
PulseShapeFitOOTPileupCorrection.cc:110
symbols
Definition:
symbols.py:1
edm::ELfwkInfo
constexpr const ELseverityLevel ELfwkInfo
Definition:
ELseverityLevel.h:98
edm::ELzeroSeverity
constexpr const ELseverityLevel ELzeroSeverity
Definition:
ELseverityLevel.h:92
edm::ELseverityLevel::ELsev_info
Definition:
ELseverityLevel.h:38
edm::ELseverityLevel::ELseverityLevel
constexpr ELseverityLevel(ELsev_ lev=ELsev_unspecified) noexcept
Definition:
ELseverityLevel.h:58
edm::ELseverityLevel::getVarName
const std::string & getVarName() const
Definition:
ELseverityLevel.cc:146
Generated for CMSSW Reference Manual by
1.8.16