1#ifndef __JDB_JLOGGERMESSAGE__
2#define __JDB_JLOGGERMESSAGE__
24namespace JPP {
using namespace JDB; }
55 if (datalog.
source == MESSAGE_TAG) {
59 istringstream is(datalog.
data);
63 this->
datim.
set(datalog.
utc / 1000, (
float) (datalog.
utc%1000) * 1.0e-3,
true);
65 while (is.peek() != EOF && isspace((
char) is.peek())) { is.ignore(1); }
67 getline(is, this->
data);
91 if (!message.
tag .empty() && message.
tag !=
tag) {
return false; }
94 if (!message.
ip .empty() && message.
ip !=
ip) {
return false; }
96 if (!message.
level .empty() && message.
level !=
level) {
return false; }
97 if (!message.
data .empty() && !regex_match(
data, regex(message.
data))) {
return false; }
112 return (
tag != DISPTAG_Born.toString() &&
113 tag != DISPTAG_Died.toString());
124 return (
long int) 1000 * (
long int)
datim.
getTime() + (
long int) 500;
141 in >>
object.file_name
145 if (
object.
tag != DISPTAG_Born.toString() &&
146 object.tag != DISPTAG_Died.toString()) {
153 while (in.peek() != EOF && isspace((
char) in.peek())) { in.ignore(1); }
155 return getline(in,
object.
data);
159 return in >>
object.fullname;
176 if (
object.
tag != DISPTAG_Born.toString() &&
177 object.tag != DISPTAG_Died.toString()) {
180 <<
object.tag <<
' ' << right;
181 out <<
object.datim <<
' ';
184 out <<
object.nickname <<
' ';
190 out <<
object.tag <<
' ';
192 out <<
object.fullname;
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
General purpose message reporting.
Exception for opening of file.
Exception for parsing value.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
KM3NeT DAQ data structures and auxiliaries.
Auxiliary data structure for datalog strings.
Auxiliary data structure for logger message.
bool hasTime() const
Check if message has date and time.
long int getTime() const
Get UTC time.
friend std::istream & operator>>(std::istream &in, JLoggerMessage &object)
Read message from input.
JLoggerMessage()
Default constructor.
bool match(const JLoggerMessage &message) const
Get match.
friend std::ostream & operator<<(std::ostream &out, const JLoggerMessage &object)
Write message to output.
JLoggerMessage(const JDatalogString &datalog)
Copy constructor.
Auxiliary class for date and time.
time_t getTime() const
time
void set(const bool utc=false)
Set to current local time.
Auxiliary data structure for alignment of data.