59{
   63 
   65 
   67  string         egrep;
   73 
   74  try { 
   75 
   79 
   87 
   91 
   96 
   97    JParser<> zap(
"Auxiliary application to examine datalog file.");
 
   98    
   99    zap[
'f'] = 
make_field(datalogstringFile,    
"datalog file");
 
  100    zap[
'e'] = 
make_field(egrep,                
"filter, precede with '!' to invert") = 
"";
 
  106    
  107    zap(argc, argv);
  108  }
  109  catch(const exception& error) {
  110    FATAL(error.what() << endl);
 
  111  }
  112 
  113 
  115 
  116  try {
  117    for (const auto& filename : datalogstringFile) {
  118      datalogs.
load(filename);
 
  119    }
  120  }
  121  catch(const exception& error) {
  122    FATAL(error.what() << endl);
 
  123  }
  124 
  125  {
  126    JDatalogs_t::iterator __end = datalogs.end();
  127 
  128    for (JDatalogs_t::iterator i = datalogs.begin(); i != __end; ) {
  129 
  130      bool status = UTC(i->utc);
  131 
  132      if (!egrep.empty()) {
  133 
  134        if (egrep[0] != '!' && !regex_match(i->data, regex(".*" + egrep.substr(0) + ".*"))) { status = false; }
  135        if (egrep[0] == '!' &&  regex_match(i->data, regex(".*" + egrep.substr(1) + ".*"))) { status = false; }
  136      }
  137 
  138      if (status) {
  139 
  141 
  143 
  144        else if (i->source == RC_REPLY.toString())
  145 
  147 
  148        else
  149 
  150          status = i->match(datalog);
  151      }
  152 
  153      if (status)
  154        ++i;
  155      else
  156        iter_swap(i, --__end);
  157    }
  158 
  159    datalogs.erase(__end, datalogs.end());
  160  }
  161 
  163 
  164  for (const auto& datalog : datalogs) {
  165    print(cout, datalog);
 
  166  }
  167}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
 
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
 
Utility class to parse parameter values.
 
Utility class to parse command line options.
 
std::ostream & print(std::ostream &out, const JTestSummary &summary, const char delimiter=' ', const bool useColors=true)
Print test summary.
 
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
 
static const std::string MESSAGE_TAG
Message logging tag.
 
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
 
KM3NeT DAQ data structures and auxiliaries.
 
Type definition of range.
 
Auxiliary data structure for datalog strings.
 
Container for datalog strings.
 
void load(const std::string &file_name)
Load message from input file.
 
Auxiliary data structure for logger message.
 
bool match(const JLoggerMessage &message) const
Get match.
 
Auxiliary data structure for reply message.
 
bool match(const JReplyMessage &message) const
Get match.
 
Empty structure for specification of parser element that is initialised (i.e. does not require input)...