[docs] add config panel screenshots

pull/1031/head
Tim Stack 2 years ago
parent 1fd274ce24
commit ebe2e0d8e6

@ -118,6 +118,10 @@ lnav v0.11.0:
* In cases where there were many different colors on screen, some
text would be colored incorrectly.
* The pretty-print view now handles ANSI escape sequences.
* The "overstrike" convention for doing bold and underline is now
supported. (Overstrike is a character followed by a backspace
and then the same character for bold or an underscore for
underline.)
lnav v0.10.1:
Features:

@ -259,7 +259,8 @@ Session
* - Keypress
- Command
* - :kbd:`Ctrl` + :kbd:`R`
- Reset the current :ref:`session<sessions>` state.
- Reset the current :ref:`session<sessions>` state. The session state
includes things like filters, bookmarks, and hidden fields.
Query Prompts
-------------

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

@ -76,9 +76,22 @@ current view, typing in "hi" will filter the list down to the "HIST" value.
Configuration Panels
--------------------
.. figure:: lnav-config-header.png
:align: center
:figwidth: 90%
Screenshot of the header for the configuration panels when they are hidden.
After the main view content, there is a header bar for two configuration
panels: Files and Filters. These panels provide visual access to parts of
lnav's configuration.
lnav's configuration. To access the panels, press the :kbd:`TAB` key.
To hide the panels again, press :kbd:`q`.
.. figure:: lnav-files-panel.png
:align: center
:figwidth: 90%
Screenshot of the files panel showing the loaded files.
The Files panel is open initially to display progress in loading files.
The following information can be displayed for each file:
@ -90,6 +103,12 @@ The following information can be displayed for each file:
* the notes recorded for files where some automatic action was taken,
like hiding the file if it was seen as a duplicate of another file.
.. figure:: lnav-filters-panel.png
:align: center
:figwidth: 90%
Screenshot of the filters panel showing an OUT and a disabled IN filter.
If the view supports filtering, there will be a status line showing the
following:
@ -100,30 +119,40 @@ To edit the filters, you can press TAB to change the focus from the main
view to the filter editor. The editor allows you to create, enable/disable,
and delete filters easily.
Bottom Status Bar
-----------------
The second to last line is the bottom status bar, which shows the following:
* the line number of the top line, starting from zero;
* the location within the view, as a percentage;
* the current search hit, the total number of hits, and the search term;
* the loading indicator.
When the interactive prompt is active, this bar can show the prompt
description, help text, or error message.
Prompt
------
Finally, the last line on the display is where you can enter search
patterns and execute internal commands, such as converting a
unix-timestamp into a human-readable date. The command-line is by
the readline library, so the usual set of keyboard shortcuts can
be used.
The body of the display is also used to display other content, such
as: the help file, histograms of the log messages over time, and
SQL results. The views are organized into a stack so that any time
you activate a new view with a key press or command, the new view
is pushed onto the stack. Pressing the same key again will pop the
view off of the stack and return you to the previous view. Note
that you can always use 'q' to pop the top view off of the stack.
.. _ui_views:
Views
-----
The accessible content within lnav is separated into the following views.
LOG
^^^
The log view displays the log messages from any loaded log files in time
order.
order. This view will be shown by default if any log messages are available.
On color displays, the log messages will be highlighted as follows:
@ -144,19 +173,66 @@ On color displays, the log messages will be highlighted as follows:
:config /ui/theme grayscale
The breadcrumb bar will show:
The breadcrumb bar will show the following crumbs:
* the timestamp
* the timestamp for the top line;
* the log format for the top line;
* the name of the file the top line was pulled from;
* the line number for the top line in the display;
* the current search hit, the total number of hits, and the search term;
* the "operation ID" of the top log message, if it is supported by the log
format.
These crumbs are interactive and can be used to navigate to different parts
of the log view. For example, selecting a different value in the log format
crumb will jump to the first message with that format.
TEXT
^^^^
The text view displays files for which lnav could not detect any log messages.
Files with an :code:`.md` extension will be treated as Markdown files and
rendered separately.
DB
^^
The DB view shows the results of queries done through the SQLite interface.
You can execute a query by pressing :kbd:`;` and then entering a SQL statement.
You can switch to the SQL view by pressing :kbd:`v`.
HELP
^^^^
The help view displays the builtin help text. Press :kbd:`?` to switch to the
help view at any time. While in the help view, the breadcrumb bar can be used
to navigate to different sections of the document.
HIST
^^^^
The histogram view displays a stacked bar chart of messages over time
classified by their log level and whether they've been bookmarked. Press
:kbd:`i` to switch back and forth to the histogram view. You can also press
:kbd:`Shift`+:kbd:`i` to toggle the histogram view while synchronizing the top
time. While in the histogram view, pressing :kbd:`z`/:kbd:`Shift`+:kbd:`z`
will zoom in/out.
PRETTY
^^^^^^
The pretty-print view takes the text displayed in the current view and shows
the result of a pretty-printer run on that text. For example, if a log
message contained an XML message on a single line, the pretty-printer would
break the XML across multiple lines with appropriate indentation.
SCHEMA
^^^^^^
The schema view displays the current schema of the builtin SQLite database.
SPECTRO
^^^^^^^
The spectrogram view is a "three"-dimensional display of values of a log field
or a SQL column. The dimensions are time on the Y axis, the range of values
on the X axis, and number of data points as a color.

@ -42,7 +42,7 @@
static pcrepp&
ansi_regex()
{
static pcrepp retval("\x1b\\[([\\d=;\\?]*)([a-zA-Z])|(.)\b\\3|.\b_|_\b.");
static pcrepp retval("\x1b\\[([\\d=;\\?]*)([a-zA-Z])|(?:[^\b]\b[^\b])+");
return retval;
}
@ -61,32 +61,69 @@ scrub_ansi_string(std::string& str, string_attrs_t* sa)
auto* caps = context.all();
const auto sf = pi.get_string_fragment(caps);
if (sf.length() == 3 && sf[1] == '\b') {
if (sf.length() >= 3 && sf[1] == '\b') {
ssize_t fill_index = sf.sf_begin;
ssize_t erased_size = (sf.length() / 3) * 2;
ssize_t output_size = sf.length() / 3;
line_range bold_range;
line_range ul_range;
if (sa != nullptr) {
shift_string_attrs(*sa, caps->c_begin + 1, -2);
if (sf[0] == '_' || sf[2] == '_') {
sa->emplace_back(
line_range{caps->c_begin, caps->c_begin + 1},
VC_STYLE.value(text_attrs{A_UNDERLINE}));
shift_string_attrs(
*sa, caps->c_begin + sf.length() / 3, -erased_size);
sa->emplace_back(line_range{last_origin_offset_end,
caps->c_begin + (int) output_size},
SA_ORIGIN_OFFSET.value(origin_offset));
}
for (size_t triple_index = 0; triple_index < output_size;
triple_index++)
{
char lhs = sf[triple_index * 3];
char rhs = sf[triple_index * 3 + 2];
if (lhs == '_' || rhs == '_') {
if (sa != nullptr && bold_range.is_valid()) {
sa->emplace_back(bold_range,
VC_STYLE.value(text_attrs{A_BOLD}));
bold_range.clear();
}
if (ul_range.is_valid()) {
ul_range.lr_end += 1;
} else {
ul_range.lr_start = fill_index;
ul_range.lr_end = fill_index + 1;
}
str[fill_index++] = lhs == '_' ? rhs : lhs;
} else {
sa->emplace_back(
line_range{caps->c_begin, caps->c_begin + 1},
VC_STYLE.value(text_attrs{A_BOLD}));
if (sa != nullptr && ul_range.is_valid()) {
sa->emplace_back(
ul_range, VC_STYLE.value(text_attrs{A_UNDERLINE}));
ul_range.clear();
}
if (bold_range.is_valid()) {
bold_range.lr_end += 1;
} else {
bold_range.lr_start = fill_index;
bold_range.lr_end = fill_index + 1;
}
str[fill_index++] = rhs;
}
sa->emplace_back(
line_range{last_origin_offset_end, caps->c_begin + 1},
SA_ORIGIN_OFFSET.value(origin_offset));
}
if (sf[0] == '_') {
str.erase(str.begin() + caps->c_begin,
str.begin() + caps->c_end - 1);
last_origin_offset_end = caps->c_begin + 1;
} else {
str.erase(str.begin() + caps->c_begin + 1,
str.begin() + caps->c_end);
last_origin_offset_end = caps->c_begin + 1;
if (sa != nullptr && ul_range.is_valid()) {
sa->emplace_back(ul_range,
VC_STYLE.value(text_attrs{A_UNDERLINE}));
ul_range.clear();
}
origin_offset += 2;
if (sa != nullptr && bold_range.is_valid()) {
sa->emplace_back(bold_range,
VC_STYLE.value(text_attrs{A_BOLD}));
bold_range.clear();
}
str.erase(str.begin() + fill_index, str.begin() + caps->c_end);
last_origin_offset_end = caps->c_begin + output_size;
origin_offset += erased_size;
pi.reset(str);
continue;
}

@ -51,7 +51,9 @@ struct line_range {
int lr_end;
explicit line_range(int start = -1, int end = -1)
: lr_start(start), lr_end(end){};
: lr_start(start), lr_end(end)
{
}
bool is_valid() const { return this->lr_start != -1; }
@ -62,6 +64,11 @@ struct line_range {
bool empty() const { return this->length() == 0; }
void clear() {
this->lr_start = -1;
this->lr_end = -1;
}
int end_for_string(const std::string& str) const
{
return this->lr_end == -1 ? str.length() : this->lr_end;

@ -199,15 +199,15 @@ discover_metadata_int(const attr_line_t& al, metadata_builder& mb)
}
for (auto& interval : intervals) {
auto start_off_opt
= get_string_attr(orig_attrs, &SA_ORIGIN_OFFSET, interval.start);
if (start_off_opt) {
interval.start += start_off_opt.value()->sa_value.get<int64_t>();
auto start_off_iter = find_string_attr_containing(
orig_attrs, &SA_ORIGIN_OFFSET, interval.start);
if (start_off_iter != orig_attrs.end()) {
interval.start += start_off_iter->sa_value.get<int64_t>();
}
auto stop_off_opt
= get_string_attr(orig_attrs, &SA_ORIGIN_OFFSET, interval.stop - 1);
if (stop_off_opt) {
interval.stop += stop_off_opt.value()->sa_value.get<int64_t>();
auto stop_off_iter = find_string_attr_containing(
orig_attrs, &SA_ORIGIN_OFFSET, interval.stop - 1);
if (stop_off_iter != orig_attrs.end()) {
interval.stop += stop_off_iter->sa_value.get<int64_t>();
}
}

@ -37,6 +37,8 @@
#include "readline_highlighters.hh"
#include "readline_possibilities.hh"
using namespace lnav::roles::literals;
filter_sub_source::filter_sub_source(std::shared_ptr<readline_curses> editor)
: fss_editor(editor)
{
@ -488,6 +490,8 @@ filter_sub_source::rl_change(readline_curses* rc)
void
filter_sub_source::rl_perform(readline_curses* rc)
{
static const intern_string_t INPUT_SRC = intern_string::lookup("input");
textview_curses* top_view = *lnav_data.ld_view_stack.top();
text_sub_source* tss = top_view->get_sub_source();
filter_stack& fs = tss->get_filters();
@ -514,6 +518,18 @@ filter_sub_source::rl_perform(readline_curses* rc)
nullptr))
== nullptr)
{
auto um = lnav::console::user_message::error(
"invalid regular expression")
.with_reason(errptr)
.with_snippet(lnav::console::snippet::from(
INPUT_SRC, new_value));
um.um_snippets.back()
.s_content.append("\n")
.append(eoff, ' ')
.append("^ "_comment)
.append(lnav::roles::comment(errptr));
lnav_data.ld_exec_context.ec_error_callback_stack.back()(
um);
this->rl_abort(rc);
} else {
tf->lf_deleted = true;
@ -548,6 +564,16 @@ filter_sub_source::rl_perform(readline_curses* rc)
nullptr);
#endif
if (retcode != SQLITE_OK) {
auto sqlerr = annotate_sql_with_error(
lnav_data.ld_db.in(), full_sql.c_str(), nullptr);
auto um
= lnav::console::user_message::error(
"invalid SQL expression")
.with_reason(sqlite3_errmsg(lnav_data.ld_db.in()))
.with_snippet(lnav::console::snippet::from(
INPUT_SRC, sqlerr));
lnav_data.ld_exec_context.ec_error_callback_stack.back()(
um);
this->rl_abort(rc);
} else {
lnav_data.ld_log_source.set_sql_filter(new_value,

@ -210,6 +210,9 @@ view_curses::mvwattrline(WINDOW* window,
}
}
}
if (lr_bytes.lr_start == -1) {
lr_bytes.lr_start = expanded_line.size();
}
if (lr_bytes.lr_end == -1) {
lr_bytes.lr_end = expanded_line.size();
}

@ -46,12 +46,12 @@ int
main(int argc, char* argv[])
{
{
std::string boldish = "a\ba _\ba a\b_ b";
std::string boldish = "h\bhe\bel\blo\bo _\ba_\bb_\bc a\b_ b";
string_attrs_t sa;
sa.clear();
scrub_ansi_string(boldish, &sa);
assert(boldish == "a a a b");
assert(boldish == "helo abc a b");
for (const auto& attr : sa) {
printf("attr %d:%d %s\n",
attr.sa_range.lr_start,

Loading…
Cancel
Save