LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
mf::ELseverityLevel Class Reference

#include "ELseverityLevel.h"

Public Types

enum  ELsev_ {
  ELsev_noValueAssigned, ELsev_zeroSeverity, ELsev_success, ELsev_info,
  ELsev_warning, ELsev_error, ELsev_unspecified, ELsev_severe,
  ELsev_highestSeverity, nLevels
}
 

Public Member Functions

constexpr ELseverityLevel (ELsev_ lev=ELsev_unspecified)
 
 ELseverityLevel (std::string const &str)
 
int cmp (ELseverityLevel e) const
 
int getLevel () const
 
std::string getSymbol () const
 
std::string getName () const
 
std::string getInputStr () const
 
std::string getVarName () const
 

Private Attributes

int myLevel
 

Friends

std::ostream & operator<< (std::ostream &os, ELseverityLevel const sev)
 

Detailed Description

Definition at line 25 of file ELseverityLevel.h.

Member Enumeration Documentation

Enumerator
ELsev_noValueAssigned 
ELsev_zeroSeverity 
ELsev_success 
ELsev_info 
ELsev_warning 
ELsev_error 
ELsev_unspecified 
ELsev_severe 
ELsev_highestSeverity 
nLevels 

Definition at line 28 of file ELseverityLevel.h.

Constructor & Destructor Documentation

constexpr mf::ELseverityLevel::ELseverityLevel ( ELsev_  lev = ELsev_unspecified)
inline

Definition at line 62 of file ELseverityLevel.h.

63  : myLevel{level}
64  {}
mf::ELseverityLevel::ELseverityLevel ( std::string const &  str)

Definition at line 49 of file ELseverityLevel.cc.

50  {
51  static map<string const, mf::ELseverityLevel::ELsev_> const& m = loadMap();
52  auto i = m.find(s);
53  myLevel = (i == m.end()) ? ELsev_unspecified : i->second;
54  }
Float_t s
Definition: plot.C:23

Member Function Documentation

int mf::ELseverityLevel::cmp ( ELseverityLevel  e) const

Definition at line 57 of file ELseverityLevel.cc.

References myLevel.

Referenced by mf::operator!=(), mf::operator<(), mf::operator<=(), mf::operator==(), mf::operator>(), and mf::operator>=().

58  {
59  return myLevel - e.myLevel;
60  }
Float_t e
Definition: plot.C:34
string mf::ELseverityLevel::getInputStr ( ) const

Definition at line 141 of file ELseverityLevel.cc.

142  {
143  string result;
144  switch (myLevel) {
145  default:
146  result = "?no value?";
147  break;
148  case ELsev_zeroSeverity:
149  result = "ZERO";
150  break;
151  case ELsev_success:
152  result = "DEBUG";
153  break;
154  case ELsev_info:
155  result = "INFO";
156  break;
157  case ELsev_warning:
158  result = "WARNING";
159  break;
160  case ELsev_error:
161  result = "ERROR";
162  break;
163  case ELsev_unspecified:
164  result = "UNSPECIFIED";
165  break;
166  case ELsev_severe:
167  result = "SYSTEM";
168  break;
170  result = "HIGHEST";
171  break;
172  }
173  return result;
174  }
int mf::ELseverityLevel::getLevel ( ) const

Definition at line 63 of file ELseverityLevel.cc.

Referenced by mfplugins::ELsyslog::syslogLevel().

64  {
65  return myLevel;
66  }
string mf::ELseverityLevel::getName ( ) const

Definition at line 105 of file ELseverityLevel.cc.

Referenced by mf::operator<<().

106  {
107  string result;
108  switch (myLevel) {
109  default:
110  result = "?no value?";
111  break;
112  case ELsev_zeroSeverity:
113  result = "--";
114  break;
115  case ELsev_success:
116  result = "Debug";
117  break;
118  case ELsev_info:
119  result = "Info";
120  break;
121  case ELsev_warning:
122  result = "Warning";
123  break;
124  case ELsev_error:
125  result = "Error";
126  break;
127  case ELsev_unspecified:
128  result = "??";
129  break;
130  case ELsev_severe:
131  result = "System";
132  break;
134  result = "!!";
135  break;
136  }
137  return result;
138  }
string mf::ELseverityLevel::getSymbol ( ) const

Definition at line 69 of file ELseverityLevel.cc.

Referenced by mf::LogErrorObj().

70  {
71  string result;
72  switch (myLevel) {
73  default:
74  result = "0";
75  break;
76  case ELsev_zeroSeverity:
77  result = "--";
78  break;
79  case ELsev_success:
80  result = "-d";
81  break;
82  case ELsev_info:
83  result = "-i";
84  break;
85  case ELsev_warning:
86  result = "-w";
87  break;
88  case ELsev_error:
89  result = "-e";
90  break;
91  case ELsev_unspecified:
92  result = "??";
93  break;
94  case ELsev_severe:
95  result = "-s";
96  break;
98  result = "!!";
99  break;
100  }
101  return result;
102  }
string mf::ELseverityLevel::getVarName ( ) const

Definition at line 177 of file ELseverityLevel.cc.

178  {
179  string result;
180  switch (myLevel) {
181  default:
182  result = "?no value? ";
183  break;
184  case ELsev_zeroSeverity:
185  result = "ELzeroSeverity ";
186  break;
187  case ELsev_success:
188  result = "ELdebug ";
189  break;
190  case ELsev_info:
191  result = "ELinfo ";
192  break;
193  case ELsev_warning:
194  result = "ELwarning ";
195  break;
196  case ELsev_error:
197  result = "ELerror ";
198  break;
199  case ELsev_unspecified:
200  result = "ELunspecified ";
201  break;
202  case ELsev_severe:
203  result = "ELsystem ";
204  break;
206  result = "ELhighestSeverity";
207  break;
208  }
209  return result;
210  }

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
ELseverityLevel const  sev 
)
friend

Definition at line 213 of file ELseverityLevel.cc.

214  {
215  return os << " -" << sev.getName() << "- ";
216  }

Member Data Documentation

int mf::ELseverityLevel::myLevel
private

Definition at line 59 of file ELseverityLevel.h.

Referenced by cmp().


The documentation for this class was generated from the following files: