Auxiliary data structure for logger message.
More...
#include <JLoggerMessage.hh>
Auxiliary data structure for logger message.
Definition at line 36 of file JLoggerMessage.hh.
JDB::JLoggerMessage::JLoggerMessage |
( |
| ) |
|
|
inline |
Copy constructor.
- Parameters
-
Definition at line 49 of file JLoggerMessage.hh.
53 using namespace KM3NETDAQ;
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); }
71 THROW(JParseError,
"Invalid string " << datalog.
source <<
" " << datalog.
data);
76 THROW(JParseError,
"Invalid source " << datalog.
source);
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
void set(const bool utc=false)
Set to current local time.
static const std::string MESSAGE_TAG
Message logging tag.
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
bool JDB::JLoggerMessage::match |
( |
const JLoggerMessage & |
message | ) |
const |
|
inline |
Get match.
- Parameters
-
- Returns
- true if message matches; else false
Definition at line 87 of file JLoggerMessage.hh.
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; }
bool JDB::JLoggerMessage::hasTime |
( |
| ) |
const |
|
inline |
Check if message has date and time.
- Returns
- true if messages has date and time; else false
Definition at line 108 of file JLoggerMessage.hh.
static const JTag DISPTAG_Died("Died")
static const JTag DISPTAG_Born("Born")
std::string toString() const
Convert tag to string.
long int JDB::JLoggerMessage::getTime |
( |
| ) |
const |
|
inline |
Get UTC time.
- Returns
- time [ms]
Definition at line 122 of file JLoggerMessage.hh.
124 return (
long int) 1000 * (
long int)
datim.
getTime() + (
long int) 500;
time_t getTime() const
time
std::istream& operator>> |
( |
std::istream & |
in, |
|
|
JLoggerMessage & |
object |
|
) |
| |
|
friend |
Read message from input.
- Parameters
-
in | input stream |
object | message |
- Returns
- input stream
Definition at line 135 of file JLoggerMessage.hh.
141 in >>
object.file_name
153 while (
in.peek() != EOF && isspace((
char)
in.peek())) {
in.ignore(1); }
159 return in >>
object.fullname;
static const JTag DISPTAG_Died("Died")
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
static const JTag DISPTAG_Born("Born")
std::string toString() const
Convert tag to string.
then fatal The output file must have the wildcard in the e g root fi eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
JLoggerMessage()
Default constructor.
std::ostream& operator<< |
( |
std::ostream & |
out, |
|
|
const JLoggerMessage & |
object |
|
) |
| |
|
friend |
Write message to output.
- Parameters
-
out | output stream |
object | message |
- Returns
- output stream
Definition at line 171 of file JLoggerMessage.hh.
180 <<
object.tag <<
' ' << right;
181 out <<
object.datim <<
' ';
184 out <<
object.nickname <<
' ';
190 out <<
object.tag <<
' ';
192 out <<
object.fullname;
static const JTag DISPTAG_Died("Died")
static const JTag DISPTAG_Born("Born")
std::string toString() const
Convert tag to string.
std::string JDB::JLoggerMessage::file_name |
std::string JDB::JLoggerMessage::tag |
std::string JDB::JLoggerMessage::process |
std::string JDB::JLoggerMessage::ip |
std::string JDB::JLoggerMessage::nickname |
std::string JDB::JLoggerMessage::fullname |
std::string JDB::JLoggerMessage::level |
std::string JDB::JLoggerMessage::data |
The documentation for this struct was generated from the following file: