mirror of https://github.com/tstack/lnav.git
parent
7f5916d480
commit
36e46fc67b
|
@ -308,7 +308,7 @@ void log_format::check_for_new_year(std::vector<logline> &dst, exttm etm,
|
|||
if (diff <= 0) {
|
||||
return;
|
||||
}
|
||||
if (diff > (60 * 24 * 60 * 60)) {
|
||||
if ((etm.et_flags & ETF_MONTH_SET) && diff >= (24 * 60 * 60)) {
|
||||
off_year = 1;
|
||||
} else if (diff >= (24 * 60 * 60)) {
|
||||
off_month = 1;
|
||||
|
|
|
@ -149,9 +149,11 @@ bool logfile::process_prefix(off_t offset, shared_buffer_ref &sbr)
|
|||
{
|
||||
log_format::scan_result_t found = log_format::SCAN_NO_MATCH;
|
||||
size_t prescan_size = this->lf_index.size();
|
||||
time_t prescan_time = 0;
|
||||
bool retval = false;
|
||||
|
||||
if (this->lf_format.get() != NULL) {
|
||||
prescan_time = this->lf_index[0].get_time();
|
||||
/* We've locked onto a format, just use that scanner. */
|
||||
found = this->lf_format->scan(this, this->lf_index, offset, sbr);
|
||||
}
|
||||
|
@ -208,6 +210,9 @@ bool logfile::process_prefix(off_t offset, shared_buffer_ref &sbr)
|
|||
|
||||
switch (found) {
|
||||
case log_format::SCAN_MATCH:
|
||||
if (!this->lf_index.empty() && prescan_time != this->lf_index[0].get_time()) {
|
||||
retval = true;
|
||||
}
|
||||
if (prescan_size > 0 && prescan_size < this->lf_index.size()) {
|
||||
logline &second_to_last = this->lf_index[prescan_size - 1];
|
||||
logline &latest = this->lf_index[prescan_size];
|
||||
|
|
|
@ -133,13 +133,13 @@ drive_grep_proc_SOURCES = drive_grep_proc.cc
|
|||
drive_grep_proc_LDADD = ../src/libdiag.a $(PCRE_LIBS) -lz
|
||||
|
||||
drive_json_op_SOURCES = drive_json_op.cc
|
||||
drive_json_op_LDADD = ../src/libdiag.a $(PCRE_LIBS) -lz
|
||||
drive_json_op_LDADD = ../src/libdiag.a $(PCRE_LIBS) -lz $(CURSES_LIB)
|
||||
|
||||
drive_json_ptr_walk_SOURCES = drive_json_ptr_walk.cc
|
||||
drive_json_ptr_walk_LDADD = ../src/libdiag.a $(PCRE_LIBS) -lz
|
||||
drive_json_ptr_walk_LDADD = ../src/libdiag.a $(PCRE_LIBS) -lz $(CURSES_LIB)
|
||||
|
||||
drive_listview_SOURCES = drive_listview.cc
|
||||
drive_listview_LDADD = ../src/libdiag.a $(CURSES_LIB) -lz \
|
||||
drive_listview_LDADD = ../src/libdiag.a $(CURSES_LIB) -lz $(CURSES_LIB) \
|
||||
$(CONFIG_OBJS)
|
||||
|
||||
drive_logfile_SOURCES = drive_logfile.cc
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
Nov 3 09:23:38 veridian automount[7998]: lookup(file): lookup for foobar failed
|
||||
Nov 3 09:23:38 veridian automount[16442]: attempting to mount entry /auto/opt
|
||||
Nov 3 09:23:38 veridian automount[7999]: lookup(file): lookup for opt failed
|
||||
Nov 3 09:47:02 veridian sudo: timstack : TTY=pts/6 ; PWD=/auto/wstimstack/rpms/lbuild/test ; USER=root ; COMMAND=/usr/bin/tail /var/log/messages
|
||||
Feb 3 09:23:38 veridian automount[7998]: lookup(file): lookup for foobar failed
|
|
@ -721,6 +721,23 @@ check_output "histogram is not working?" <<EOF
|
|||
}
|
||||
EOF
|
||||
|
||||
cp ${test_dir}/logfile_rollover.1 logfile_rollover.1
|
||||
touch -t 200711030923 ${srcdir}/logfile_rollover.1
|
||||
chmod ug+w logfile_rollover.1
|
||||
|
||||
run_test ${lnav_test} -n \
|
||||
-c ":shexec echo 'Jan 3 09:23:38 veridian automount[16442]: attempting to mount entry /auto/opt' >> logfile_rollover.1" \
|
||||
-c ":rebuild" \
|
||||
-c ":switch-to-view histogram" \
|
||||
logfile_rollover.1
|
||||
|
||||
check_output "rollover is not working with histogram" <<EOF
|
||||
Tue Nov 03 09:20:00 1 normal 2 errors 0 warnings 0 marks
|
||||
Tue Nov 03 09:45:00 1 normal 0 errors 0 warnings 0 marks
|
||||
Wed Feb 03 09:20:00 0 normal 1 errors 0 warnings 0 marks
|
||||
Tue Jan 03 09:20:00 1 normal 0 errors 0 warnings 0 marks
|
||||
EOF
|
||||
|
||||
touch -t 200711030923 ${srcdir}/logfile_syslog.0
|
||||
run_test ${lnav_test} -n \
|
||||
-c ":switch-to-view histogram" \
|
||||
|
|
Loading…
Reference in New Issue