[out-of-order] some more tweaks for out-of-order

pull/306/merge
Timothy Stack 9 years ago
parent cdd43549ab
commit 9213a6b58b

@ -111,8 +111,9 @@ size_t field_overlay_source::list_overlay_count(const listview_curses &lv)
struct exttm tm;
if (format->lf_date_time.scan(time_src, time_range.length(),
format->get_timestamp_formats(),
&tm, actual_tv)) {
format->get_timestamp_formats(),
&tm, actual_tv,
false)) {
sql_strftime(orig_timestamp, sizeof(orig_timestamp), actual_tv, 'T');
time_str.append("; Actual Time: ");
time_lr.lr_start = time_str.length();

@ -392,7 +392,8 @@ public:
};
void index_line(logfile_sub_source &lss, logfile *lf, logfile::iterator ll) {
if (ll->get_level() & logline::LEVEL_CONTINUED) {
if (ll->get_level() & logline::LEVEL_CONTINUED ||
ll->get_time() == 0) {
return;
}

@ -454,7 +454,8 @@ const char *date_time_scanner::scan(const char *time_dest,
size_t time_len,
const char * const time_fmt[],
struct exttm *tm_out,
struct timeval &tv_out)
struct timeval &tv_out,
bool convert_local)
{
int curr_time_fmt = -1;
bool found = false;
@ -479,7 +480,7 @@ const char *date_time_scanner::scan(const char *time_dest,
if (sscanf(time_cp, "+%d%n", &gmt_int, &off) == 1) {
time_t gmt = gmt_int;
if (this->dts_local_time) {
if (convert_local && this->dts_local_time) {
localtime_r(&gmt, &tm_out->et_tm);
#ifdef HAVE_STRUCT_TM_TM_ZONE
tm_out->et_tm.tm_zone = NULL;
@ -513,7 +514,7 @@ const char *date_time_scanner::scan(const char *time_dest,
if (tm_out->et_tm.tm_year < 70) {
tm_out->et_tm.tm_year = 80;
}
if (this->dts_local_time) {
if (convert_local && this->dts_local_time) {
time_t gmt = tm2sec(&tm_out->et_tm);
this->to_localtime(gmt, *tm_out);
@ -536,7 +537,7 @@ const char *date_time_scanner::scan(const char *time_dest,
if (tm_out->et_tm.tm_year < 70) {
tm_out->et_tm.tm_year = 80;
}
if (this->dts_local_time) {
if (convert_local && this->dts_local_time) {
time_t gmt = tm2sec(&tm_out->et_tm);
this->to_localtime(gmt, *tm_out);

@ -304,7 +304,8 @@ struct date_time_scanner {
size_t time_len,
const char * const time_fmt[],
struct exttm *tm_out,
struct timeval &tv_out);
struct timeval &tv_out,
bool convert_local = true);
bool convert_to_timeval(const std::string &time_src,
struct timeval &tv_out) {

@ -205,7 +205,7 @@ void logfile::process_prefix(off_t offset, shared_buffer_ref &sbr)
logline &latest = this->lf_index.back();
if (latest < second_to_last) {
log_debug("%s:%d: out-of-time-order line detected %d.%06d < %d.%06d",
log_debug("%s:%d: out-of-time-order line detected %d.%03d < %d.%03d",
this->lf_filename.c_str(),
this->lf_index.size(),
latest.get_time(),

Loading…
Cancel
Save