#include "error_cooker.h"
-static const String unix_date_re("[[:alpha:]]{3} [[:alpha:]]{3} [ 123][0-9] [0-9]{2}:[0-9]{2}:[0-9]{2} [0-9]{4}");
-static const regex re_errorlog("^\\[" + unix_date_re + "\\] \\[(error|notice|warn|info)\\] .+");
+static const String unix_date_re("[[:alpha:]]{3} [[:alpha:]]{3} [ 0123][0-9] [0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)? [0-9]{4}");
+static const regex re_errorlog("^\\[" + unix_date_re + "\\] \\[.*(error|notice|warn|info|debug)\\] .+");
bool error_cooker::check_pattern(String logline)
{
}
log_service = pan.lc->service();
log_date = pan.lc->timestamp();
+
+ if (!log_date.proper())
+ {
+ *Log << log_date << " is not a valid timestamp.\n";
+ }
}
else
{
}
}
+ else
+ {
+ *Log << "Can not insert log element " << raw << ".\n";
+ }
}
node = node->next;