Skip to content

Commit 1633ba1

Browse files
committed
[docs] breakpoints
1 parent ff8b96c commit 1633ba1

2 files changed

Lines changed: 72 additions & 0 deletions

File tree

docs/source/sqltab.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ the following tables/views:
1111
* `lnav_events`_
1212
* `lnav_file`_
1313
* `lnav_file_metadata`_
14+
* `lnav_log_breakpoints`_
1415
* `lnav_user_notifications`_
1516
* `lnav_views`_
1617
* `lnav_views_echo`_
@@ -147,6 +148,40 @@ loaded file. Currently,
147148
:mimetype: The MIME type of the metadata.
148149
:content: The metadata itself.
149150

151+
152+
.. _table_lnav_log_breakpoints:
153+
154+
lnav_log_breakpoints
155+
--------------------
156+
157+
The :code:`lnav_log_breakpoints` table allows you to view and manage
158+
breakpoints set on log messages. Breakpoints mark log messages that
159+
share a particular source file location or message schema, making it
160+
easy to navigate between related log lines using the :kbd:`F7` and
161+
:kbd:`F8` keys.
162+
163+
You can :code:`SELECT`, :code:`INSERT`, :code:`UPDATE`, and
164+
:code:`DELETE` breakpoints through this table. The columns in the
165+
table are as follows:
166+
167+
:schema_id: The schema identifier for the breakpoint. This value
168+
matches the :code:`log_msg_schema` column in the :code:`all_logs`
169+
table.
170+
:description: A human-readable description of the breakpoint
171+
(e.g. :code:`format_name:file.cc:42`).
172+
:type: The source of the schema ID, either :code:`src_location` or
173+
:code:`message_schema`.
174+
:enabled: Indicates whether the breakpoint is active (1 or 0).
175+
176+
.. code-block:: custsqlite
177+
178+
;SELECT * FROM lnav_log_breakpoints
179+
180+
;UPDATE lnav_log_breakpoints SET enabled = 0 WHERE description LIKE '%main.cc%'
181+
182+
;DELETE FROM lnav_log_breakpoints WHERE description LIKE '%test%'
183+
184+
150185
.. _table_lnav_user_notifications:
151186

152187
lnav_user_notifications

docs/source/usage.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,43 @@ Log level
300300
To hide messages below a certain log level, you can use the
301301
:ref:`:set-min-log-level<set_min_log_level>` command.
302302

303+
304+
Log-oriented Debugging
305+
----------------------
306+
307+
Breakpoints
308+
^^^^^^^^^^^
309+
310+
Breakpoints let you mark log messages that originate from a particular
311+
source file location (e.g. :code:`main.cc:42`) or that share a common
312+
message schema. Log messages that have a source location and match a
313+
breakpoint will be highlighted with a red circle, making it easy to spot
314+
related messages as you scroll through logs.
315+
316+
To toggle a breakpoint on the focused log message, press :kbd:`Ctrl` +
317+
:kbd:`B` or use the :ref:`:breakpoint<breakpoint>` command.
318+
You can also set breakpoints explicitly with the
319+
:ref:`:breakpoint<breakpoint>` command, specifying a
320+
:code:`[format:]file:line` location.
321+
322+
Once breakpoints are set, you can jump between matching log messages
323+
using the :kbd:`F7` and :kbd:`F8` keys to move to the previous and next
324+
breakpoint hit, respectively.
325+
326+
Breakpoints can be disabled without deleting them using the
327+
:ref:`:toggle-breakpoint<toggle_breakpoint>` command.
328+
The :ref:`lnav_log_breakpoints<table_lnav_log_breakpoints>`
329+
SQL table, which allows you to query, insert, update, and delete breakpoints.
330+
For example, to disable all breakpoints matching a file:
331+
332+
.. code-block:: custsqlite
333+
334+
;UPDATE lnav_log_breakpoints SET enabled = 0 WHERE description LIKE '%main.cc%'
335+
336+
Breakpoints are saved as part of the session, so they will be restored
337+
the next time you open the same files.
338+
339+
303340
.. _search_tables:
304341

305342
Search Tables

0 commit comments

Comments
 (0)