Skip to content

Commit 44fda81

Browse files
committed
[logfile] find lower time cutoff
Related to #1188 and #1585
1 parent 7838a73 commit 44fda81

File tree

3 files changed

+238
-84
lines changed

3 files changed

+238
-84
lines changed

src/log_format.cc

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2060,12 +2060,14 @@ external_log_format::scan(logfile& lf,
20602060
if (orig_lock != curr_fmt) {
20612061
uint32_t lock_line;
20622062

2063-
log_debug("%s:%zu: changing pattern lock %d -> (%d)%s",
2064-
lf.get_unique_path().c_str(),
2065-
dst.size() - 1,
2066-
orig_lock,
2067-
curr_fmt,
2068-
this->elf_pattern_order[curr_fmt]->p_name.c_str());
2063+
if (!this->lf_specialized && orig_lock != -1) {
2064+
log_debug("%s:%zu: changing pattern lock %d -> (%d)%s",
2065+
lf.get_unique_path().c_str(),
2066+
dst.size() - 1,
2067+
orig_lock,
2068+
curr_fmt,
2069+
this->elf_pattern_order[curr_fmt]->p_name.c_str());
2070+
}
20692071
if (sbc.sbc_pattern_locks.empty()) {
20702072
lock_line = 0;
20712073
} else {
@@ -2076,7 +2078,7 @@ external_log_format::scan(logfile& lf,
20762078
return scan_match{1000};
20772079
}
20782080

2079-
if (this->lf_specialized && !this->lf_multiline) {
2081+
if (this->lf_specialized && !this->lf_multiline && !dst.empty()) {
20802082
const auto& last_line = dst.back();
20812083

20822084
log_debug("%s: invalid line %zu file_offset=%" PRIu64,

0 commit comments

Comments
 (0)