[docs] start updating screenshots

This commit is contained in:
Tim Stack 2022-08-07 10:00:34 -07:00
parent 3df07139b3
commit c52615c424
13 changed files with 72 additions and 31 deletions

View File

@ -1,4 +1,3 @@
.. role:: lnavcmd(code)
:language: lnav
:class: highlight
@ -20,6 +19,7 @@ the screenshot below shows the help for the :code:`:open` command:
.. figure:: open-help.png
:align: center
:figwidth: 50%
Screenshot of the online help for the :code:`:open` command.
@ -46,7 +46,7 @@ preview behavior for the string "launchd":
.. figure:: filter-out-preview.png
:align: center
Screenshot showing the preview for the :code:`:filter-out launchd` command.
Screenshot showing the preview for the :code:`:filter-out` command.
Any errors detected during preview will be shown in the status bar right above
the command prompt. For example, an attempt to open an unknown file will show

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 KiB

After

Width:  |  Height:  |  Size: 674 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 61 KiB

View File

@ -1,4 +1,3 @@
.. _hotkeys:
Hotkey Reference
@ -149,6 +148,8 @@ Bookmarks
* - :kbd:`Shift` + :kbd:`c`
- Clear marked lines
.. _hotkeys_display:
Display
-------

Binary file not shown.

Before

Width:  |  Height:  |  Size: 327 KiB

After

Width:  |  Height:  |  Size: 902 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 96 KiB

View File

@ -1,36 +1,32 @@
.. _ui:
User Interface
==============
The main part of the display shows the log messages from all files sorted by the
message time. Status bars at the top and bottom of the screen can given you an
idea of where you are in the logs. And, the last line is used for entering
commands. Navigation is controlled by a series of hotkeys, see :ref:`hotkeys`
for more information.
The **lnav** TUI displays the content of the current "view" in the middle,
with status bars above and below, and the interactive prompt as the last line.
.. figure:: lnav-ui.png
:align: center
:alt: Screenshot showing syslog messages.
:alt: Screenshot of lnav showing a mix of syslog and web access_log messages.
Screenshot of **lnav** viewing syslog messages.
On color displays, the log messages will be highlighted as follows:
* Errors will be colored in red;
* warnings will be yellow;
* search hits are reverse video;
* various color highlights will be applied to: IP addresses, SQL keywords,
XML tags, file and line numbers in Java backtraces, and quoted strings;
* "identifiers" in the messages will be randomly assigned colors based on their
content (works best on "xterm-256color" terminals).
The default view shows the log messages from the log files that have been
loaded. There are other views for displaying content like plaintext files
and SQL results. The :ref:`ui_views` section describes the characteristics of
each view in more detail. You can switch to the different views using the
hotkeys described in the :ref:`hotkeys_display` section or by pressing
:kbd:`ENTER` to activate the breadcrumb bar, moving to the first crumb, and
then selecting the desired view. You can switch back to the previous view by
pressing :kbd:`q`. You can switch forward to the new view by pressing
:kbd:`a`.
The right side of the display has a proportionally sized 'scrollbar' that
shows:
* your current position in the file;
* the locations of errors/warnings in the log files by using a red or yellow
* the current position in the file;
* the locations of errors/warnings in the log files by using red or yellow
coloring;
* the locations of search hits by using a tick-mark pointing to the left;
* the locations of bookmarks by using a tick-mark pointing to the right.
@ -67,3 +63,42 @@ 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
-----
LOG
^^^
The log view displays the log messages from any loaded log files in time
order.
On color displays, the log messages will be highlighted as follows:
* Errors will be colored in red;
* warnings will be yellow;
* search hits are reverse video;
* various color highlights will be applied to: IP addresses, SQL keywords,
XML tags, file and line numbers in Java backtraces, and quoted strings;
* "identifiers" in the messages will be randomly assigned colors based on their
content (works best on "xterm-256color" terminals).
.. note::
If the coloring is too much for your tastes, you can change to the
"grayscale" theme by entering the following command:
.. code-block:: lnav
:config /ui/theme grayscale
DB
^^
HELP
^^^^
HIST
^^^^

View File

@ -137,9 +137,8 @@ key_sql_callback(exec_context& ec, sqlite3_stmt* stmt)
value = null_value_t{};
break;
default:
value = string_fragment::from_bytes(
sqlite3_value_text(raw_value),
sqlite3_value_bytes(raw_value));
value = std::string((const char*) sqlite3_value_text(raw_value),
sqlite3_value_bytes(raw_value));
break;
}
vars[column_name] = value;

View File

@ -1767,7 +1767,8 @@ com_filter(exec_context& ec,
highlighter hl(compile_res.unwrap());
auto role = (args[0] == "filter-out") ? role_t::VCR_DIFF_DELETE
: role_t::VCR_DIFF_ADD;
hl.with_attrs(text_attrs{A_BLINK});
hl.with_role(role);
hl.with_attrs(text_attrs{A_BLINK | A_REVERSE});
hm[{highlight_source_t::PREVIEW, "preview"}] = hl;
tc->reload_data();

View File

@ -194,10 +194,14 @@ readline_command_highlighter_int(attr_line_t& al, int x, line_range sub)
styling::color_unit::from_str(hash_color)
.then([&](const auto& rgb_fg) {
auto color = view_colors::singleton().match_color(rgb_fg);
alb.template overlay_attr(
line_range{sub.lr_start + cap->c_begin,
sub.lr_start + cap->c_begin + 1},
VC_ROLE.value(role_t::VCR_COLOR_HINT));
VC_STYLE.value(text_attrs{
A_BOLD,
color,
}));
});
}
}

View File

@ -168,10 +168,10 @@
"color": "$yellow"
},
"diff-delete": {
"color": "#8f5247"
"color": "#f00"
},
"diff-add": {
"color": "#294436"
"color": "#0f0"
},
"diff-section": {
"color": "#656e76"

View File

@ -324,7 +324,8 @@ view_curses::mvwattrline(WINDOW* window,
} else if (iter->sa_type == &SA_LEVEL) {
attrs = vc.vc_level_attrs[iter->sa_value.get<int64_t>()].first;
} else if (iter->sa_type == &VC_ROLE) {
attrs = vc.attrs_for_role(iter->sa_value.get<role_t>());
auto role = iter->sa_value.get<role_t>();
attrs = vc.attrs_for_role(role);
} else if (iter->sa_type == &VC_ROLE_FG) {
auto role_attrs
= vc.attrs_for_role(iter->sa_value.get<role_t>());

View File

@ -360,8 +360,8 @@ CREATE TABLE lnav_views (
bool do_filtering,
const char* top_meta)
{
textview_curses& tc = lnav_data.ld_views[index];
text_time_translator* time_source
auto& tc = lnav_data.ld_views[index];
auto* time_source
= dynamic_cast<text_time_translator*>(tc.get_sub_source());
if (tc.get_top() != top_row) {