8#include "daq/slc/database/DAQLogMessage.h"
10#include <daq/slc/base/Date.h>
14DAQLogMessage::DAQLogMessage()
16 m_date =
Date().get();
24DAQLogMessage::DAQLogMessage(
const std::string& nodename,
25 LogFile::Priority priority,
26 const std::string& message)
28 m_date =
Date().get();
29 m_nodename = nodename;
30 m_priority = (int)priority;
36DAQLogMessage::DAQLogMessage(
const std::string& nodename,
37 LogFile::Priority priority,
38 const std::string& message,
42 m_nodename = nodename;
43 m_priority = (int)priority;
49DAQLogMessage::DAQLogMessage(
const std::string& nodename,
50 LogFile::Priority priority,
51 const std::string& category,
52 const std::string& message)
54 m_date =
Date().get();
55 m_nodename = nodename;
56 m_priority = (int)priority;
58 setCategory(category);
62DAQLogMessage::DAQLogMessage(
const std::string& nodename,
63 LogFile::Priority priority,
65 const std::string& message)
67 m_date =
Date().get();
68 m_nodename = nodename;
69 m_priority = (int)priority;
71 setCategory(category);
75DAQLogMessage::DAQLogMessage(
const std::string& nodename,
76 LogFile::Priority priority,
77 const std::string& category,
78 const std::string& message,
82 m_nodename = nodename;
83 m_priority = (int)priority;
85 setCategory(category);
89DAQLogMessage::DAQLogMessage(
const std::string& nodename,
90 LogFile::Priority priority,
92 const std::string& message,
96 m_nodename = nodename;
97 m_priority = (int)priority;
99 setCategory(category);
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();
113void DAQLogMessage::setPriority(LogFile::Priority priority)
115 m_priority = (int)priority;
118void DAQLogMessage::setNodeName(
const std::string& name)
123int DAQLogMessage::getCategory()
const
128const std::string DAQLogMessage::getCategoryName()
const
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";
149void DAQLogMessage::setCategory(
int category)
151 m_category = category;
154void DAQLogMessage::setCategory(
const std::string& category)
156 if (category ==
"PXD") {
158 }
else if (category ==
"SVD") {
160 }
else if (category ==
"CDC") {
162 }
else if (category ==
"TOP") {
164 }
else if (category ==
"ARICH") {
166 }
else if (category ==
"ECL") {
168 }
else if (category ==
"KLM") {
170 }
else if (category ==
"TRG") {
172 }
else if (category ==
"TTD") {
174 }
else if (category ==
"HLT") {
176 }
else if (category ==
"HVC") {
178 }
else if (category ==
"MON") {
180 }
else if (category ==
"DAQ") {
187void DAQLogMessage::setMessage(
const std::string& message)
192void DAQLogMessage::setDate()
197void DAQLogMessage::setDate(
int date)
202void DAQLogMessage::setDate(
const Date& date)
207LogFile::Priority DAQLogMessage::getPriority()
const
209 return (LogFile::Priority) m_priority;
212int DAQLogMessage::getPriorityInt()
const
217const std::string& DAQLogMessage::getNodeName()
const
222const std::string& DAQLogMessage::getMessage()
const
227int DAQLogMessage::getDateInt()
const
232const Date DAQLogMessage::getDate()
const
237const std::string DAQLogMessage::getPriorityText()
const
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";
Abstract base class for different kinds of events.