@@ -765,6 +765,17 @@ field_overlay_source::list_value_for_overlay(
765765 this ->build_meta_line (lv, value_out, row);
766766}
767767
768+ field_overlay_source::lss_state
769+ field_overlay_source::lss_state::from (logfile_sub_source& lss)
770+ {
771+ return {
772+ lss.get_filters ().fs_generation ,
773+ lss.get_min_row_time (),
774+ lss.get_max_row_time (),
775+ lss.get_min_log_level (),
776+ };
777+ }
778+
768779bool
769780field_overlay_source::list_static_overlay (const listview_curses& lv,
770781 int y,
@@ -773,11 +784,60 @@ field_overlay_source::list_static_overlay(const listview_curses& lv,
773784{
774785 const std::vector<attr_line_t >* lines = nullptr ;
775786 if (this ->fos_lss .text_line_count () == 0 ) {
776- if (this ->fos_tss .empty ()) {
787+ if (this ->fos_lss .file_count () > 0 ) {
788+ auto curr_state = lss_state::from (this ->fos_lss );
789+ if (this ->fos_static_lines .empty ()
790+ || curr_state != this ->fos_static_lines_state )
791+ {
792+ auto msg = lnav::console::user_message::info (
793+ " All log messages are currently hidden" );
794+ if (curr_state.ls_min_time ) {
795+ msg.with_note (attr_line_t (" Logs before " )
796+ .append_quoted (lnav::to_rfc3339_string (
797+ curr_state.ls_min_time .value ()))
798+ .append (" are not being shown" ));
799+ }
800+ if (curr_state.ls_max_time ) {
801+ msg.with_note (attr_line_t (" Logs after " )
802+ .append_quoted (lnav::to_rfc3339_string (
803+ curr_state.ls_max_time .value ()))
804+ .append (" are not being shown" ));
805+ }
806+ if (curr_state.ls_min_level > log_level_t ::LEVEL_UNKNOWN ) {
807+ msg.with_note (
808+ attr_line_t (" Logs with a level below " )
809+ .append_quoted (
810+ level_names[this ->fos_lss .get_min_log_level ()])
811+ .append (" are not being shown" ));
812+ }
813+ auto & fs = this ->fos_lss .get_filters ();
814+ for (const auto & filt : fs) {
815+ auto hits = this ->fos_lss .get_filtered_count_for (
816+ filt->get_index ());
817+ if (filt->get_type () == text_filter::EXCLUDE && hits == 0 ) {
818+ continue ;
819+ }
820+ auto cmd = attr_line_t (" :" + filt->to_command ());
821+ readline_command_highlighter (cmd, std::nullopt );
822+ msg.with_note (
823+ attr_line_t (" Filter " )
824+ .append_quoted (cmd)
825+ .append (" matched " )
826+ .append (lnav::roles::number (fmt::to_string (hits)))
827+ .append (" message(s) " ));
828+ }
829+ this ->fos_static_lines = msg.to_attr_line ().split_lines ();
830+ this ->fos_static_lines_state = curr_state;
831+ }
832+
833+ lines = &this ->fos_static_lines ;
834+ } else if (this ->fos_tss .empty ()) {
777835 lines = lnav::messages::view::no_files ();
778836 } else {
779837 lines = lnav::messages::view::only_text_files ();
780838 }
839+ } else {
840+ this ->fos_static_lines .clear ();
781841 }
782842
783843 if (lines != nullptr && y < (ssize_t ) lines->size ()) {
0 commit comments