Belle II Software development
DAQLogMessage Class Reference

Public Member Functions

 DAQLogMessage (const std::string &nodename, LogFile::Priority priority, const std::string &message)
 
 DAQLogMessage (const std::string &nodename, LogFile::Priority priority, const std::string &message, const Date &date)
 
 DAQLogMessage (const std::string &nodename, const std::string &priority, const std::string &message, const Date &date)
 
 DAQLogMessage (const std::string &nodename, LogFile::Priority priority, const std::string &category, const std::string &message)
 
 DAQLogMessage (const std::string &nodename, LogFile::Priority priority, int category, const std::string &message)
 
 DAQLogMessage (const std::string &nodename, LogFile::Priority priority, const std::string &category, const std::string &message, const Date &date)
 
 DAQLogMessage (const std::string &nodename, LogFile::Priority priority, int category, const std::string &message, const Date &date)
 
 DAQLogMessage (const DAQLogMessage &log)
 
void setId (int id)
 
void setPriority (const std::string &priority)
 
void setPriority (LogFile::Priority priority)
 
void setCategory (int category)
 
void setCategory (const std::string &category)
 
void setNodeName (const std::string &name)
 
void setMessage (const std::string &message)
 
void setDate ()
 
void setDate (int date)
 
void setDate (const Date &date)
 
int getId () const
 
LogFile::Priority getPriority () const
 
int getCategory () const
 
const std::string getCategoryName () const
 
int getPriorityInt () const
 
const std::string getPriorityText () const
 
const std::string & getNodeName () const
 
const std::string & getMessage () const
 
int getDateInt () const
 
const Date getDate () const
 

Private Attributes

int m_date
 
std::string m_nodename
 
int m_priority
 
std::string m_message
 
int m_id
 
int m_category
 

Detailed Description

Definition at line 23 of file DAQLogMessage.h.

Constructor & Destructor Documentation

◆ DAQLogMessage() [1/8]

Definition at line 14 of file DAQLogMessage.cc.

15{
16 m_date = Date().get();
17 m_nodename = "";
18 m_priority = 0;
19 m_message = "";
20 m_category = 13;
21 m_id = -1;
22}

◆ DAQLogMessage() [2/8]

DAQLogMessage ( const std::string &  nodename,
LogFile::Priority  priority,
const std::string &  message 
)

Definition at line 24 of file DAQLogMessage.cc.

27{
28 m_date = Date().get();
29 m_nodename = nodename;
30 m_priority = (int)priority;
31 m_message = message;
32 m_category = 13;
33 m_id = -1;
34}

◆ DAQLogMessage() [3/8]

DAQLogMessage ( const std::string &  nodename,
LogFile::Priority  priority,
const std::string &  message,
const Date date 
)

Definition at line 36 of file DAQLogMessage.cc.

40{
41 m_date = date.get();
42 m_nodename = nodename;
43 m_priority = (int)priority;
44 m_message = message;
45 m_category = 13;
46 m_id = -1;
47}

◆ DAQLogMessage() [4/8]

DAQLogMessage ( const std::string &  nodename,
LogFile::Priority  priority,
const std::string &  category,
const std::string &  message 
)

Definition at line 49 of file DAQLogMessage.cc.

53{
54 m_date = Date().get();
55 m_nodename = nodename;
56 m_priority = (int)priority;
57 m_message = message;
58 setCategory(category);
59 m_id = -1;
60}

◆ DAQLogMessage() [5/8]

DAQLogMessage ( const std::string &  nodename,
LogFile::Priority  priority,
int  category,
const std::string &  message 
)

Definition at line 62 of file DAQLogMessage.cc.

66{
67 m_date = Date().get();
68 m_nodename = nodename;
69 m_priority = (int)priority;
70 m_message = message;
71 setCategory(category);
72 m_id = -1;
73}

◆ DAQLogMessage() [6/8]

DAQLogMessage ( const std::string &  nodename,
LogFile::Priority  priority,
const std::string &  category,
const std::string &  message,
const Date date 
)

Definition at line 75 of file DAQLogMessage.cc.

80{
81 m_date = date.get();
82 m_nodename = nodename;
83 m_priority = (int)priority;
84 m_message = message;
85 setCategory(category);
86 m_id = -1;
87}

◆ DAQLogMessage() [7/8]

DAQLogMessage ( const std::string &  nodename,
LogFile::Priority  priority,
int  category,
const std::string &  message,
const Date date 
)

Definition at line 89 of file DAQLogMessage.cc.

94{
95 m_date = date.get();
96 m_nodename = nodename;
97 m_priority = (int)priority;
98 m_message = message;
99 setCategory(category);
100 m_id = -1;
101}

◆ DAQLogMessage() [8/8]

DAQLogMessage ( const DAQLogMessage log)

Definition at line 103 of file DAQLogMessage.cc.

104{
105 m_date = log.getDateInt();
106 m_nodename = log.getNodeName();
107 m_priority = log.getPriorityInt();
108 m_message = log.getMessage();
109 m_category = log.getCategory();
110 m_id = log.getId();
111}

◆ ~DAQLogMessage()

virtual ~DAQLogMessage ( )
inlinevirtual

Definition at line 65 of file DAQLogMessage.h.

65{}

Member Function Documentation

◆ getCategory()

int getCategory ( ) const

Definition at line 123 of file DAQLogMessage.cc.

124{
125 return m_category;
126}

◆ getCategoryName()

const std::string getCategoryName ( ) const

Definition at line 128 of file DAQLogMessage.cc.

129{
130 switch (m_category) {
131 case 1: return "PXD";
132 case 2: return "SVD";
133 case 3: return "CDC";
134 case 4: return "TOP";
135 case 5: return "ARICH";
136 case 6: return "ECL";
137 case 7: return "KLM";
138 case 8: return "TRG";
139 case 9: return "TTD";
140 case 10: return "HLT";
141 case 11: return "HVC";
142 case 12: return "MON";
143 case 13: return "DAQ";
144 default: break;
145 }
146 return "";
147}

◆ getDate()

const Date getDate ( ) const

Definition at line 232 of file DAQLogMessage.cc.

233{
234 return Date(m_date);
235}

◆ getDateInt()

int getDateInt ( ) const

Definition at line 227 of file DAQLogMessage.cc.

228{
229 return m_date;
230}

◆ getId()

int getId ( ) const
inline

Definition at line 78 of file DAQLogMessage.h.

78{ return m_id; }

◆ getMessage()

const std::string & getMessage ( ) const

Definition at line 222 of file DAQLogMessage.cc.

223{
224 return m_message;
225}

◆ getNodeName()

const std::string & getNodeName ( ) const

Definition at line 217 of file DAQLogMessage.cc.

218{
219 return m_nodename;
220}

◆ getPriority()

LogFile::Priority getPriority ( ) const

Definition at line 207 of file DAQLogMessage.cc.

208{
209 return (LogFile::Priority) m_priority;
210}

◆ getPriorityInt()

int getPriorityInt ( ) const

Definition at line 212 of file DAQLogMessage.cc.

213{
214 return m_priority;
215}

◆ getPriorityText()

const std::string getPriorityText ( ) const

Definition at line 237 of file DAQLogMessage.cc.

238{
239 switch (getPriority()) {
240 case LogFile::DEBUG: return "DEBUG";
241 case LogFile::INFO: return "INFO";
242 case LogFile::NOTICE: return "NOTICE";
243 case LogFile::WARNING: return "WARNING";
244 case LogFile::ERROR: return "ERROR";
245 case LogFile::FATAL: return "FATAL";
246 default:
247 break;
248 }
249 return "UNKNOWN";
250}

◆ setCategory() [1/2]

void setCategory ( const std::string &  category)

Definition at line 154 of file DAQLogMessage.cc.

155{
156 if (category == "PXD") {
157 m_category = 1;
158 } else if (category == "SVD") {
159 m_category = 2;
160 } else if (category == "CDC") {
161 m_category = 3;
162 } else if (category == "TOP") {
163 m_category = 4;
164 } else if (category == "ARICH") {
165 m_category = 5;
166 } else if (category == "ECL") {
167 m_category = 6;
168 } else if (category == "KLM") {
169 m_category = 7;
170 } else if (category == "TRG") {
171 m_category = 8;
172 } else if (category == "TTD") {
173 m_category = 9;
174 } else if (category == "HLT") {
175 m_category = 10;
176 } else if (category == "HVC") {
177 m_category = 11;
178 } else if (category == "MON") {
179 m_category = 12;
180 } else if (category == "DAQ") {
181 m_category = 13;
182 } else {
183 m_category = -1;
184 }
185}

◆ setCategory() [2/2]

void setCategory ( int  category)

Definition at line 149 of file DAQLogMessage.cc.

150{
151 m_category = category;
152}

◆ setDate() [1/3]

void setDate ( )

Definition at line 192 of file DAQLogMessage.cc.

193{
194 setDate(Date());
195}

◆ setDate() [2/3]

void setDate ( const Date date)

Definition at line 202 of file DAQLogMessage.cc.

203{
204 m_date = date.get();
205}

◆ setDate() [3/3]

void setDate ( int  date)

Definition at line 197 of file DAQLogMessage.cc.

198{
199 m_date = date;
200}

◆ setId()

void setId ( int  id)
inline

Definition at line 68 of file DAQLogMessage.h.

68{ m_id = id; }

◆ setMessage()

void setMessage ( const std::string &  message)

Definition at line 187 of file DAQLogMessage.cc.

188{
189 m_message = message;
190}

◆ setNodeName()

void setNodeName ( const std::string &  name)

Definition at line 118 of file DAQLogMessage.cc.

119{
120 m_nodename = name;
121}

◆ setPriority()

void setPriority ( LogFile::Priority  priority)

Definition at line 113 of file DAQLogMessage.cc.

114{
115 m_priority = (int)priority;
116}

Member Data Documentation

◆ m_category

int m_category
private

Definition at line 95 of file DAQLogMessage.h.

◆ m_date

int m_date
private

Definition at line 90 of file DAQLogMessage.h.

◆ m_id

int m_id
private

Definition at line 94 of file DAQLogMessage.h.

◆ m_message

std::string m_message
private

Definition at line 93 of file DAQLogMessage.h.

◆ m_nodename

std::string m_nodename
private

Definition at line 91 of file DAQLogMessage.h.

◆ m_priority

int m_priority
private

Definition at line 92 of file DAQLogMessage.h.


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