pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lnav: update to 0.12.4 on wip/lnav



Module Name:	pkgsrc-wip
Committed By:	Marko Kaznovac <kaznovac%gmail.com@localhost>
Pushed By:	kaznovac
Date:		Mon Mar 24 13:13:51 2025 +0100
Changeset:	4e089019a4fbb999b73592139ca0fba3ee029d45

Modified Files:
	Makefile
Added Files:
	lnav/COMMIT_MSG
	lnav/DESCR
	lnav/Makefile
	lnav/PLIST
	lnav/TODO
	lnav/distinfo
	lnav/patches/patch-src_command__executor.cc
	lnav/patches/patch-src_ptimec.hh
	lnav/patches/patch-src_spectro__source.cc
	lnav/patches/patch-src_test__override.c
	lnav/patches/patch-src_third-party_rapidyaml_ryml__all.hpp
	lnav/patches/patch-src_vtab__module.hh

Log Message:
lnav: update to 0.12.4 on wip/lnav

todo: build fails on NetBSD

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=4e089019a4fbb999b73592139ca0fba3ee029d45

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile                                           |   1 +
 lnav/COMMIT_MSG                                    | 574 +++++++++++++++++++++
 lnav/DESCR                                         |  14 +
 lnav/Makefile                                      |  34 ++
 lnav/PLIST                                         |   3 +
 lnav/TODO                                          |  15 +
 lnav/distinfo                                      |  11 +
 lnav/patches/patch-src_command__executor.cc        |  21 +
 lnav/patches/patch-src_ptimec.hh                   |  25 +
 lnav/patches/patch-src_spectro__source.cc          |  23 +
 lnav/patches/patch-src_test__override.c            |  16 +
 .../patch-src_third-party_rapidyaml_ryml__all.hpp  |  25 +
 lnav/patches/patch-src_vtab__module.hh             |  23 +
 13 files changed, 785 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index c27f6f1d0f..75b3bcef4d 100644
--- a/Makefile
+++ b/Makefile
@@ -2241,6 +2241,7 @@ SUBDIR+=	lldb
 SUBDIR+=	llilc-git
 SUBDIR+=	llvm
 SUBDIR+=	lmdbg-current
+SUBDIR+=	lnav
 SUBDIR+=	lnd
 SUBDIR+=	lodepng-git
 SUBDIR+=	logcli
diff --git a/lnav/COMMIT_MSG b/lnav/COMMIT_MSG
new file mode 100644
index 0000000000..5f196c5027
--- /dev/null
+++ b/lnav/COMMIT_MSG
@@ -0,0 +1,574 @@
+sysutils/lnav: update to 0.12.4
+
+## lnav v0.12.4
+
+Features:
+* Log message timestamps are now represented with microsecond
+  precision internally instead of just millisecond.
+* The `log_time` and `log_level` fields can now be hidden.
+* The "Op ID:" overlay that is added when the `log_opid` field is
+  manually set on a message can now be hidden by hiding the
+  `log_opid` field.
+* Pasting a command snippet when the input focus is on the main
+  view will now execute it.
+  For this to work: the terminal must support "bracketed-paste"
+  mode, which most do;
+  and, the pasted content must also start with one of the sigils
+  for the desired operation (i.e. `:` for lnav commands, `;` for SQL
+  queries, `/` for searches, and `|` for scripts).
+* Added a `report-access-log` script that generates a report that
+  is similar to the output of the [goaccess](https://goaccess.io)
+  utility.
+* Added a `find-msg` script that can be used to find the
+  next/previous message with a field that matches the value of the
+  field in the focused message.
+* Added a `find-chained-msg` script that can be used to find the
+  next/previous message where a target field matches the value of
+  the source field in the focused message.
+* Scripts can now specify their output format using the
+  `@output-format:` documentation description.
+  This setting can affect the output of some commands, like
+  `:write-table-to` which will output Markdown tables when the
+  output is set to `text/markdown`.
+* Column alignment in Markdown tables is now supported.
+* Added ecs_log for the Elastic Common Schema from @ba-didi.
+* Added a Proxifier log format.
+* Escape sequences for 24-bit color are now handled.
+* The `-i` option for installing files will now copy `.lnav`
+  script files to the `formats/installed` directory.
+* Added `italic` and `strike` to the text styling configuration.
+* DB query results can now be styled on a row-by-row basis by
+  adding a column with the name `__lnav_style__`.
+* Added `format <format-name> test <path>` management command
+  to make it easier to test a format against a file.
+  This can be helpful for determining why a file is not being
+  recognized by particular format.
+* Added a "performance" section to the documentation.
+* Session exports now include `:hide-fields` and `:show-fields`
+  commands from the session.
+  They are currently commented out by default.
+* Added highlighting for Markdown syntax.
+
+Interface changes:
+* DB query results that start with a number are right justified
+  instead of only full numbers.
+* Left-clicking a local link in a Markdown document will jump to
+  that section of the document instead of opening the overlay
+  menu.
+  You can still open the overlay menu by right-clicking on the link.
+* Rows in a Markdown table are now highlighted with alternating
+  styles.
+* Long-running SQL queries in scripts are now mentioned in the UI
+  to make it easier to see what is going on.
+* Defining a value in a log format with the same name as one of
+  predefined columns in the log virtual tables will now generate
+  an error.
+* The DB view will now chart result columns that contain a number
+  with a unit, like "KB", "MB", "GB", etc...
+* When switching to the pretty view, the focused line should be
+  in the same position in the text as in the source view.
+* In the LOG view, you can now copy the value of a field by
+  pressing `c` when focused on a line in the parser details
+  overlay (activated by pressing `p`).
+* In the DB View, if there is a column named `log_level`, it
+  will be used as the level for the row and the hotkeys for
+  jumping to the next/previous error/warning will work.
+* In the DB View, columns can now be hidden/shown using the
+  `:hide-fields` / `:show-fields` commands.
+* In the DB View, pressing `p` now works for all rows and will
+  show all columns and not just JSON ones.
+  You can then press `c` while focused in the overlay to copy
+  the value of the column.
+  Pressing space while focused on a column in the overlay will
+  hide/show it.
+* If the terminal supports less than 256 colors, a help message
+  will be displayed to try setting `TERM` to `xterm-256color`.
+* Added `F1` as a hotkey to open the help view.
+* Fixed some issues with scrolling in the main view when:
+  word-wrap was enabled; log messages had tags/comments; or
+  if the parser details overlay was open.
+
+Breaking changes:
+* The `parse_url()` SQL function no longer raises an error for an
+  invalid URL.
+  Instead, it will return a JSON object with an object with the
+  following properties:
+  - `error` - An identifier for the error.
+  - `url` - The invalid URL itself.
+  - `reason` - A description of the error.
+
+Bug Fixes:
+* Reduced startup time.
+* Reduced indexing time for plain text and JSON-lines logs.
+* Reduced memory footprint.
+* Improved search performance.
+* Reduced DB view CPU and memory usage.
+* Reduce time to open help text.
+* Improved performance of log virtual tables when ordering the
+  result by `log_line DESC`.
+* Improved performance of the `spooky_hash()` SQL function.
+
+Maintenance:
+* Replaced ncurses with notcurses.
+* Added arm64 builds for Linux/macOS
+
+## lnav v0.12.3
+
+Features:
+* Files that contain a mixture of log messages from separate
+  services (e.g. docker logs) can now be automatically
+  de-multiplexed into separate files that lnav can digest.
+* The `log_opid` column on log vtables can now be `UPDATE`d
+  so that you can manually set an opid on log messages that
+  don't have one.  Setting an opid allows messages to show
+  up in the timeline view.
+* The Files panel now has a details view on the right side
+  that shows extra information about the selected file.
+  You can look here for details of why lnav selected a
+  particular log format.
+* Add support for GitHub Markdown Alerts.
+* Added the `:xopen` command that will open the given paths
+  using an external opener like `open` or `xdg-open`.
+* Clicking on a link in a markdown file will open the Actions
+  with the following options:
+  - opening the link target in lnav or, if it's an lnav script,
+    executing the script;
+  - opening the target with `:xopen`;
+  - or, copying the link to the clipboard.
+* Added a `crash upload` command to the management CLI that will
+  upload crash logs to a server for analysis.
+* Added a `:set-text-view-mode` command that controls whether
+  file contents, such as markdown, are rendered or shown in
+  their raw state.
+* Text files with lines longer than 1024 characters will be
+  automatically pretty-printed.  You can revert to the raw view
+  using the `:set-text-view-mode` command.  The character limit
+  can be adjusted with the
+  `/tuning/textfile/max-unformatted-line-length` configuration
+  setting.
+* Added a `pretty_print()` SQL function that provides the same
+  functionality as the PRETTY view.
+* Keymap definitions can now bind to a function key using an
+  identifier that starts with `f` followed by the number of the
+  function key.
+* Added log formats for the `env_logger` and `simple_logger` Rust
+  crates.
+* Timestamp formats can now use `%j` to capture day-of-year values.
+
+Interface Changes:
+* The "Gantt Chart" view has been renamed to "timeline."
+* In the timeline view, pressing `ENTER` will focus on
+  the preview pane, so you can scroll through messages
+  with the selected Op ID.
+* With mouse mode enabled, `CTRL` can be used as an alternate
+  to `SHIFT` when clicking/dragging in the main view to
+  highlight lines.  A few terminals capture shift+clicks as a
+  way to select text and do not pass them to the application.
+* Clicking on an internal link in a Markdown document will move
+  to that section.
+* Search duration is now reported in the bottom prompt line.
+
+Bug Fixes:
+* Log messages in formats with custom timestamp formats were
+  not being converted to the local timezone.
+* The timezone offset is now shown in the parser details
+  overlay for log messages.
+* If a theme does not define `cursor-line` or `selected-text`
+  styles, the styles from the default theme will be used.
+* The first argument to a script is now the full path of the
+  script and not just the script name.
+
+Maintenance:
+* You can now do an `UPDATE` on the `lnav_top_view` SQL view.
+  This makes it easier to write queries that manipulate the
+  current view.
+* Upgrade to C++17
+
+
+## lnav v0.12.2
+
+Features:
+* Added mouse support that can be toggled with `F2` or enabled
+  by default with: `:config /ui/mouse/mode enabled`.  With
+  mouse support enabled, many of the UI elements will respond to
+  mouse inputs:
+  - clicking on the main view will move the cursor to the given
+    row and dragging will scroll the view as needed;
+  - shift + clicking/dragging in the main view will highlight
+    lines and then toggle their bookmark status on release;
+  - double-clicking in the main view will select the underlying
+    text and drag-selecting within a line will select the given
+    text;
+  - when double-clicking text: if the mouse pointer is inside
+    a quoted string, the contents of the string will be selected;
+    if the mouse pointer is on the quote, the quote will be included
+    in the selection; if the mouse pointer is over a bracket
+    (e.g. [],{},()) where the matching bracket is on the same line,
+    the selection will span from one bracket to the other;
+  - when text is selected, a menu will pop up that can be used
+    to filter based on the current text, search for it, or copy
+    it to the clipboard;
+  - right-clicking the start of a log message in the main view
+    will open the parser details overlay;
+  - the parser details now displays a diamond next to fields to
+    indicate whether they are shown/hidden and this can be
+    clicked to toggle the state;
+  - the parser details will show a bar chart icon for fields with
+    values which, when clicked, will open either the spectrogram
+    view for the given field or open the DB query prompt with a
+    PRQL query to generate a histogram of the field values;
+  - clicking in the scroll area will move the view by a page,
+    double-clicking will move the view to that area, and
+    dragging the scrollbar will move the view to the given spot;
+  - clicking on the breadcrumb bar will select a crumb and
+    selecting a possibility from the popup will move to that
+    location in the view;
+  - clicking on portions of the bottom status bar will trigger
+    a relevant action (e.g. clicking the line number will open
+    the command prompt with `:goto <current-line>`);
+  - clicking on the configuration panel tabs (i.e. Files/Filters)
+    will open the selected panel and clicking parts of the
+    display in there will perform the relevant action (e.g.
+    clicking the diamond will enable/disable the file/filter);
+  - clicking in a prompt will move the cursor to the location;
+  - clicking on a column in the spectrogram view will select it.
+
+  (Note that this is new work, so there are likely to be some
+  glitches.)
+* Added a `journald://` URL handler that will call `journalctl`
+  and pass any query parameters as options.  For example, the
+  following command:
+
+  ```
+  $ lnav 'journal://?since=yesterday'
+  ```
+
+  Will execute the following and capture the output:
+
+  ```
+  journalctl --output=json -f --since=yesterday
+  ```
+* Added the "last-word" line-format field shortening algorithm
+  from @flicus.
+* Added a `stats.hist` PRQL transform that produces a histogram
+  of values over time.
+* The preview for the `:open` command will now show a listing
+  of archive contents.
+* Added `humanize_id` SQL function that colorizes a string using
+  ANSI escape codes.
+* Added a `selected_text` column to the `lnav_views` table that
+  reports information about text that was selected with a mouse.
+  This makes it possible to script operations that use the
+  selected text as an input.
+* Added `breadcrumb` as an option to the `:prompt` command so
+  that the breadcrumb hotkey can be configured.
+
+Interface changes:
+* The bar charts in the DB view have now been moved to their
+  individual columns instead of occupying the whole width of
+  the view.  The result is much cleaner, so the charts are
+  now enabled by default again.
+* Cursor mode in the main view is now the default instead of
+  using the top line as the focus.  You can change back by
+  running:
+
+  `:config /ui/movement/mode top`
+* In the parser details panel (opened by pressing `p`), you
+  can now hide/show fields by moving the cursor line to the
+  given field and pressing the space bar or by clicking on
+  the diamond with the mouse.
+* The `sv` keymap binds `§` to focus the breadcrumb bar.
+
+Bug Fixes:
+* With the recent xz backdoor shenanigans, it seems like a good
+  time to add some checks for data being hidden by escape codes:
+  - File names with escape sequences are now displayed in quotes
+    with backslash escapes.
+  - Text that has the same foreground and background colors will
+    have the background set to a contrasting color.
+* Sub-millisecond time values should now be preserved when
+  displaying JSON-lines logs.
+* A crash during initialization on Apple Silicon and MacOS 12
+  has been fixed.
+* A crash when previewing non-text files.
+* Optimized ANSI-escape processing.
+* Various fixes to make lnav usable as a `PAGER`.
+
+## lnav v0.12.1
+
+Features:
+* Database queries can now be written in
+  [PRQL](https://prql-lang.org).  When executing a query with `;`,
+  if the query starts with `from`, it will be treated as PRQL.
+  The pipeline structure of PRQL queries is more desirable for
+  interactive use since lnav can make better suggestions and
+  show previews of the stages of the pipeline.
+* Log partitions can automatically be created by defining a log
+  message pattern in a log format.  Under a format definition,
+  add an entry into the "partitions" object in a format definition.
+  The "pattern" property specifies the regular expression to match
+  against a line in a file that matches the format.  If a match is
+  found, the partition name will be set to the value(s) captured
+  by the regex.  To restrict matches to certain files, you can add
+  a "paths" array whose object elements contain a "glob" property
+  that will be matched against file names.
+
+Interface changes:
+* When using PRQL in the database query prompt (`;`),
+  the preview pane will show the results for the pipeline
+  stage the cursor is within along with the results of
+  the previous stage (if there is one).  The preview
+  works on a limited data set, so the preview results
+  may differ from the final results.
+* Changed the breadcrumb bar styling to space things out
+  more and make the divisions between items clearer.
+* The `ESC` key can now be used to exit the files/filters
+  configuration panel instead of `q`.  This should make
+  it easier to avoid accidentally exiting lnav.
+* Added some default help text for the command prompt.
+* Suggestions are now shown for some commands and can
+  be accepted by pressing the right arrow key.  For
+  example, after typing in `:filter-in` the current
+  search term for the view will be suggested (if
+  one is active).
+* The focused line should be preserved more reliably in
+  the LOG/TEXT views.
+* In the LOG view, the current partition name (as set
+  with the `:partition-name` command) is shown as the
+  first breadcrumb in the breadcrumb bar.  And, when
+  that breadcrumb is selected, you can select another
+  partition to jump to.
+* The `{` / `}` hotkeys, `:next-section`, and `:prev-section`
+  commands now work in the LOG view and take you to the
+  next/previous partition.
+* The DB view now defaults to not showing bar charts.
+
+Breaking changes:
+* Many of the lesser used column in the log format tables
+  (e.g. `log_tags`) have been moved to after the columns
+  defined by the format.  These columns are usually `NULL`
+  and are a distraction when previewing queries.
+
+## lnav v0.12.0
+
+Features:
+* Added a Gantt Chart view to visualize operations over time
+  based on the "opid" in log messages.  The view shows
+  the operation IDs, a description of the operation captured
+  from log messages, and a bar representing the period of
+  time that the operation was running.
+* Added the `:sh` command and `-e` option to execute a shell
+  command-line and display its output within **lnav**.   The
+  captured output will be displayed in the TEXT view.  The
+  lines from stdout and stderr are recorded separately so
+  that the lines from stderr can be shown in the theme's
+  "error" highlight.  The time that the lines were received
+  are also recorded internally so that the "time-offset"
+  display (enabled by pressing `Shift` + `T`) can be shown
+  and the "jump to slow-down" hotkeys (`s`/`Shift` + `S`)
+  work.  Since the line-by-line timestamps are recorded
+  internally, they will not interfere with timestamps that
+  are in the commands output.
+* Added a `:cd` command to change **lnav**'s current directory.
+* Added support for automatically converting files that are
+  in a format not natively supported by **lnav**.  The new
+  `converter` section in a log format definition allows you
+  to specify how a file type can be detected and converted.
+  The built-in PCAP support in **lnav** is implemented using
+  this mechanism.
+* Added a `shell_exec()` SQLite function that executes a
+  command-line with the user's `$SHELL` and returns the
+  output.
+* Added support for custom URL schemes that are handled by an
+  lnav script.  Schemes can be defined under
+  `/tuning/url-schemes`.  See the main docs for more details.
+* Added `docker://` and `podman://` URL schemes that can be
+  used to tail the logs for containers (e.g.
+  `docker://my-container`) or files within a container (e.g.
+  `docker://my-serv/var/log/dpkg.log`).  Containers mentioned
+  in a "Compose" configuration file can be tailed by using
+  `compose` as the host name with the path to the configuration
+  file (e.g. `docker://compose/compose.yaml`).
+* Added an `:annotate` command that can trigger a call-out
+  to a script to analyze a log message and generate an
+  annotation that is attached to the message.  The script
+  is executed asynchronously, so it will not block input
+  and the result is saved in the session.  Annotations are
+  defined in the `/log/annotations` configuration property.
+* Timestamps with numeric timezone offsets (or `Z`) are now
+  automatically converted to the local time zone.  For
+  example, a timestamp ending in `-03:00` will be treated
+  as three hours behind UTC and then adjusted to the local
+  timezone.  This feature can be disabled by setting the
+  `/log/date-time/convert-zoned-to-local` configuration
+  property to `false`. Timestamps without a zone or have
+  a symbolic zone name (e.g. `PDT`) are not converted.
+* Added the SQLite JSON functions to the online help.
+* Added `config get` and `config blame` management CLI
+  commands to get the current configuration and the file
+  locations where the configuration options came from.
+* When piping data into **lnav**'s stdin, the input used to
+  only be written to a single file without any rotation.
+  Now, the input is written to a directory of rotating files.
+  The same is true for the command-lines executed through the
+  new `:sh` command.  The piped data can be managed using the
+  new `piper` commands in the management CLI.
+* The `$LNAV_HOME_DIR` and `$LNAV_WORK_DIR` environment
+  variables are now defined inside **lnav** and refer to
+  the location of the user's configuration directory and
+  the directory where cached data is stored, respectively.
+* The `<pre>` and `<img>` tags are now recognized in
+  Markdown files.
+* The `style` attribute in `<span>` tags is now supported.
+  The following CSS properties and values are supported:
+  * `color` and `background-color` with CSS color names
+  * `font-weight` with a value of `bold` or `bolder`
+  * `text-decoration` with `underline`
+  * `border-left` and `border-right` with the `solid`,
+    `dashed` and `dotted` line styles and colors.
+* Added an `options` column to the `lnav_views` table
+  to allow more control over overlays.
+* Added a "Dracula" theme as described at:
+  https://draculatheme.com
+* Added the following styles for themes:
+  - `/ui/theme-defs/<theme_name>/syntax-styles/inline-code`
+  - `/ui/theme-defs/<theme_name>/syntax-styles/type`
+  - `/ui/theme-defs/<theme_name>/syntax-styles/function`
+  - `/ui/theme-defs/<theme_name>/syntax-styles/separators-references-accessors`
+* Multi-line block comments (i.e. `/* ... */`) and strings
+  are now recognized and styled as appropriate.
+* Added `error` and `data` columns to the `fstat()`
+  table-valued-function.  The `error` column is non-NULL
+  if there is a problem accessing the file.  The `data`
+  contains the contents of the file, as such, it is
+  hidden by default.
+* Added a log format for Redis.
+* The `:eval` command will now treat its argument(s) as a
+  script, allowing multiple commands to be executed.
+* Added a `timezone()` SQL function for converting a timestamp
+  to a target timezone.
+* Added a `:convert-time-to` command that converts the
+  timestamp of the focused log message to the given timezone.
+* Added the `:set-file-timezone` and `:clear-file-timezone`
+  commands to set the timezone for log messages that don't
+  include a zone in their timestamp.
+* Added the `options_path` and `options` columns to the
+  `lnav_file` table so you can see what options are applied
+  to a file.  Currently, the only option is the default
+  timezone that is set by the `:set-file-timezone` command.
+* Added the `config file-options` management command that
+  can be used to examine the options that will be applied
+  to a given file.
+* When viewing a diff, the sections of the diff for each
+  file is recognized and shown in the breadcrumb bar.  So,
+  you can see the file the focused line is in.  You can
+  also jump to a particular file by focusing on the
+  breadcrumb bar, selecting the crumb, and then selecting
+  the desired file.
+* Binary files are now displayed as a hex dump with ASCII
+  representation (where applicable).
+* Added a `log_msg_line()` SQL function that will return the
+  line number of the start of the currently focused
+  message in the log view.
+* Added a `log_msg_values` column to the `all_logs` SQL
+  table that contains a JSON object with the top 5 values
+  for the fields extracted from the log message.
+* Added `:next-section` and `:prev-section` commands for
+  moving to the next and previous section of a document.
+  For example, the next section in a man page or JSON
+  array.  The default keymap has been changed to bind
+  the curly brace keys to these commands.
+* Added Nextcloud log format from Adam Monsen.
+* Added GitHub Event Log format for files from gharchive.org.
+  It makes a good example of a JSON-Lines format.
+
+Bug Fixes:
+* Binary data piped into stdin should now be treated the same
+  as if it was in a file that was passed on the command-line.
+* The `-I` option is now recognized in the management CLI
+  (i.e. when you run **lnav** with the `-m` flag).
+* Fields in the bro and w3c log formats that were hidden are
+  now saved in the session and restored.
+* A warning will now be issued if a timestamp in a log format's
+  sample message does not match completely.  Warnings in the
+  configuration can be viewed by passing the `-W` flag.
+* Importing from regex101.com broke due to some changes in the
+  API.
+* The details overlay for a log message no longer shows keys
+  for unknown JSON properties.  These extra fields are now
+  shown with the proper `jget(log_raw_text, '/...')` SQL
+  expression needed to retrieve the value.
+* Improved text-wrapping when rendering Markdown.
+
+Interface changes:
+* The breadcrumb bar hotkey is moving to backtick `` ` ``
+  instead of `ENTER`.
+* The DB view now uses the "alt-text" theme style to draw
+  alternating rows instead of being hard-coded to bold.  The
+  alternation is also now done in groups of two rows instead
+  of only a single row.  Numbers are also rendered using the
+  "number" theme style as well.
+* The log message overlay in the LOG view is now limited
+  2/3rds of the height.  You can focus on the overlay panel
+  by pressing `CTRL-]`.  The "alt-text" theme style is also
+  used to draw the overlay contents now as well. (The
+  overlay is used to display the parser details, comments,
+  and annotations.)
+* The `{` and `}` keys have been changed from moving
+  through the "location history" to moving to the previous
+  and next section in a document.
+* Added indent guidelines when structured data is detected.
+
+Breaking changes:
+* Removed the `-w` command-line option.  This option was
+  useful when stdin was not automatically preserved.  Since
+  the data is now stored (and cleaned up) as well as being
+  spread across multiple files, this option doesn't make
+  sense anymore.
+* The `-t` command-line flag behaves a little differently
+  behind the scenes now.  Timestamps will always be
+  recorded for each line piped into lnav.  This flag means
+  that the data should be treated as a log file instead of
+  plain text.
+* Data piped into **lnav** is now stored in the work
+  directory instead of the `stdin-captures` dot-lnav
+  directory.
+* Changed the "Bunyan" log format name from `bunyan` to
+  `bunyan_log` to be consistent with other format names.
+
+## lnav v0.11.2
+
+Features:
+* A "cursor" mode has been added to the main view that can
+  be toggled by pressing CTRL-X.  While in cursor mode, any
+  operations that would normally work on the "top" line will
+  now operate on the focused line instead.
+* Added CTRL-D and CTRL-U hotkeys to move down/up by half
+  a page.
+* Added an `auto-width` flag to the elements of the
+  `line-format` array that indicates that the width of the
+  field should automatically be determined by the observed
+  values.
+* Added bunyan log format from Tobias Gruetzmacher.
+* Added cloudflare log format from @minusf.
+* Number fields used in a JSON log format `line-format`
+  array now default to being right-aligned.  Also, added
+  `prefix` and `suffix` to `line-format` elements so a
+  string can optionally be prepended/appended if the value
+  is not empty.
+* JSON log format detection has been improved to not rely
+  on matching the file name.  All possible formats are
+  tried and the one with the most available fields for a
+  given `line-format` is used.  For example, if the first
+  log message has 8 fields and format A contains 5 of
+  those fields in its `line-format` while format B only
+  contains 2 of those fields in its `line-format`, format
+  A will be used for the file.
+
+Changes:
+* For JSON-lines logs, line-feeds at the end of a value are
+  automatically stripped.
+
+Bug Fixes:
+* Hidden values in JSON logs are now hidden by default.
+* Text with ANSI-escapes is now filtered properly.
diff --git a/lnav/DESCR b/lnav/DESCR
new file mode 100644
index 0000000000..0b9f801eee
--- /dev/null
+++ b/lnav/DESCR
@@ -0,0 +1,14 @@
+An advanced log file viewer for the small-scale.  Watch and analyze
+your log files from a terminal.
+
+Many logging tools, like Splunk, provide great features but are
+optimized for large-scale deployments.  They require installing
+and configuring servers before they can be effectively used.  There
+is still a need for a robust log file analyzer for the terminal.
+
+Just point lnav to a directory and it will take care of the rest.
+File formats are automatically detected and compressed files are
+unpacked on the fly.
+
+Log files are a wealth of information, lnav can help highlight the
+parts that are important and filter out the noise.
diff --git a/lnav/Makefile b/lnav/Makefile
new file mode 100644
index 0000000000..744e0e5bf2
--- /dev/null
+++ b/lnav/Makefile
@@ -0,0 +1,34 @@
+# $NetBSD: Makefile,v 1.37 2024/11/14 22:21:43 wiz Exp $
+
+DISTNAME=	lnav-0.12.4
+CATEGORIES=	sysutils textproc
+MASTER_SITES=	${MASTER_SITE_GITHUB:=tstack/}
+GITHUB_RELEASE=	v${PKGVERSION_NOREV}
+EXTRACT_SUFX=	.tar.bz2
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://lnav.org/
+COMMENT=	Log file navigator, an enhanced log viewer
+LICENSE=	2-clause-bsd
+
+GNU_CONFIGURE=		yes
+GNU_CONFIGURE_ICONV=	no
+USE_LANGUAGES=		c c++
+USE_TOOLS+=		bash:build gmake
+
+# Force it -- configure thinks it can build with c++17
+# but the program uses alloca() so depends on the gnu feature set
+FORCE_CXX_STD=	gnu++17
+
+GCC_REQD+=	8
+
+.include "../../archivers/libarchive/buildlink3.mk"
+.include "../../archivers/bzip2/buildlink3.mk"
+.include "../../databases/sqlite3/buildlink3.mk"
+.include "../../devel/pcre2/buildlink3.mk"
+.include "../../devel/readline/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../devel/ncurses/buildlink3.mk"
+.include "../../textproc/libunistring/buildlink3.mk"
+.include "../../www/curl/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/lnav/PLIST b/lnav/PLIST
new file mode 100644
index 0000000000..3aee01bdb7
--- /dev/null
+++ b/lnav/PLIST
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST,v 1.1 2015/09/05 22:12:04 wiz Exp $
+bin/lnav
+man/man1/lnav.1
diff --git a/lnav/TODO b/lnav/TODO
new file mode 100644
index 0000000000..31aa98afa6
--- /dev/null
+++ b/lnav/TODO
@@ -0,0 +1,15 @@
+# Build fails on NetBSD
+
+```
+fs_util.cc: In function 'std::optional<std::filesystem::__cxx11::path> lnav::filesystem::self_path()':
+fs_util.cc:54:18: error: 'PROC_PIDPATHINFO_MAXSIZE' was not declared in this scope
+   54 |     char pathbuf[PROC_PIDPATHINFO_MAXSIZE];
+      |                  ^~~~~~~~~~~~~~~~~~~~~~~~
+fs_util.cc:56:33: error: 'pathbuf' was not declared in this scope
+```
+
+constant `PROC_PIDPATHINFO_MAXSIZE` not defined
+ - on macOS: `MacOSX.sdk/usr/include/sys/proc_info.h:#define PROC_PIDPATHINFO_MAXSIZE        (4*MAXPATHLEN)`
+method `proc_pidpath` not defined
+ - on macOS: `MacOSX.sdk/usr/include/libproc.h:int proc_pidpath(int pid, void * buffer, uint32_t  buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);`
+
diff --git a/lnav/distinfo b/lnav/distinfo
new file mode 100644
index 0000000000..db76536e6c
--- /dev/null
+++ b/lnav/distinfo
@@ -0,0 +1,11 @@
+$NetBSD: distinfo,v 1.8 2023/05/24 22:42:53 he Exp $
+
+BLAKE2s (lnav-0.12.4.tar.bz2) = def8e56928a44115b4ba786e85b0a1338ca163d8f2649bd91d73b91bcaa0b564
+SHA512 (lnav-0.12.4.tar.bz2) = 43e3c22b17e19d8bd41b2309eb92c67bba5f4db44d597d4b513df23c3b3e477ca872824b7ac1f4274cdd0d2d536eebc65a9b98f18f31f6791b3cf118dfcb0c95
+Size (lnav-0.12.4.tar.bz2) = 3498418 bytes
+SHA1 (patch-src_command__executor.cc) = 91da4be3e437d1181aa74cb1e7d403dfcdd97a07
+SHA1 (patch-src_ptimec.hh) = f9f10f0c5156907bb4d993d9e51ba20c4fcd83ff
+SHA1 (patch-src_spectro__source.cc) = 66ca4eb992a0c8aec433245bd6faab622c82f2d2
+SHA1 (patch-src_test__override.c) = ea392929f3874ff6ef0eea0002139acb14ad9166
+SHA1 (patch-src_third-party_rapidyaml_ryml__all.hpp) = a8ad95dd2ddcd51666ba3042897c116de0dc46b1
+SHA1 (patch-src_vtab__module.hh) = c14c3439e63f0a4be0ba581712d052669a509a52
diff --git a/lnav/patches/patch-src_command__executor.cc b/lnav/patches/patch-src_command__executor.cc
new file mode 100644
index 0000000000..13a628b12c
--- /dev/null
+++ b/lnav/patches/patch-src_command__executor.cc
@@ -0,0 +1,21 @@
+$NetBSD: patch-src_command__executor.cc,v 1.1 2023/05/24 22:42:53 he Exp $
+
+Allow time_t to be long long, and adapt formats and casts accordingly.
+Also, cast a size_t before printing; unknown size so difficult to match
+format appropriately.
+
+--- src/command_executor.cc.orig	2025-02-12 19:26:00.000000000 +0000
++++ src/command_executor.cc
+@@ -541,10 +541,10 @@ execute_sql(exec_context& ec, const std:
+                     snprintf(row_count_buf,
+                              sizeof(row_count_buf),
+                              ANSI_BOLD("%'d") " row%s matched in " ANSI_BOLD(
+-                                 "%ld.%03ld") " seconds",
++                                 "%lld.%03ld") " seconds",
+                              row_count,
+                              row_count == 1 ? "" : "s",
+-                             diff_tv.tv_sec,
++                             (long long)diff_tv.tv_sec,
+                              std::max((long) diff_tv.tv_usec / 1000, 1L));
+                     retval = row_count_buf;
+                     if (dls.has_log_time_column()) {
diff --git a/lnav/patches/patch-src_ptimec.hh b/lnav/patches/patch-src_ptimec.hh
new file mode 100644
index 0000000000..a3e3496bbc
--- /dev/null
+++ b/lnav/patches/patch-src_ptimec.hh
@@ -0,0 +1,25 @@
+$NetBSD: patch-src_ptimec.hh,v 1.1 2023/05/24 22:42:53 he Exp $
+
+Don't print time_t as if it's a long; it doesn't have to be
+and may be a long long (as on NetBSD).
+
+--- src/ptimec.hh.orig	2022-08-30 20:33:38.000000000 +0000
++++ src/ptimec.hh
+@@ -333,7 +333,7 @@ ftime_s(char* dst, off_t& off_inout, ssi
+ {
+     time_t t = tm2sec(&tm.et_tm);
+ 
+-    snprintf(&dst[off_inout], len - off_inout, "%ld", t);
++    snprintf(&dst[off_inout], len - off_inout, "%lld", (long long)t);
+     off_inout = strlen(dst);
+ }
+ 
+@@ -391,7 +391,7 @@ ftime_q(char* dst, off_t& off_inout, ssi
+ {
+     time_t t = tm2sec(&tm.et_tm);
+ 
+-    snprintf(&dst[off_inout], len - off_inout, "%lx", t);
++    snprintf(&dst[off_inout], len - off_inout, "%llx", (long long)t);
+     off_inout = strlen(dst);
+ }
+ 
diff --git a/lnav/patches/patch-src_spectro__source.cc b/lnav/patches/patch-src_spectro__source.cc
new file mode 100644
index 0000000000..113d4d82ea
--- /dev/null
+++ b/lnav/patches/patch-src_spectro__source.cc
@@ -0,0 +1,23 @@
+$NetBSD: patch-src_spectro__source.cc,v 1.1 2023/05/24 22:42:53 he Exp $
+
+`role_t` isn't exactly the same as `int`, causing -Wformat
+warnings.  Cast to `int` before printing with %d.
+
+--- ./src/spectro_source.cc.orig	2022-08-11 14:19:16.000000000 +0000
++++ ./src/spectro_source.cc
+@@ -294,12 +294,12 @@ spectrogram_source::list_value_for_overl
+              sizeof(buf),
+              ANSI_ROLE("  ") " 1-%'d " ANSI_ROLE("  ") " %'d-%'d " ANSI_ROLE(
+                  "  ") " %'d+",
+-             role_t::VCR_LOW_THRESHOLD,
++             (int)role_t::VCR_LOW_THRESHOLD,
+              st.st_green_threshold - 1,
+-             role_t::VCR_MED_THRESHOLD,
++             (int)role_t::VCR_MED_THRESHOLD,
+              st.st_green_threshold,
+              st.st_yellow_threshold - 1,
+-             role_t::VCR_HIGH_THRESHOLD,
++             (int)role_t::VCR_HIGH_THRESHOLD,
+              st.st_yellow_threshold);
+     auto buflen = strlen(buf);
+     if (line.length() + buflen + 20 < width) {
diff --git a/lnav/patches/patch-src_test__override.c b/lnav/patches/patch-src_test__override.c
new file mode 100644
index 0000000000..7591bbf5d9
--- /dev/null
+++ b/lnav/patches/patch-src_test__override.c
@@ -0,0 +1,16 @@
+$NetBSD: patch-src_test__override.c,v 1.3 2023/01/17 10:18:33 wiz Exp $
+
+Match NetBSD prototype for gettimeofday().
+https://github.com/tstack/lnav/pull/1106
+
+--- src/test_override.c.orig	2015-04-04 10:42:12.000000000 +0000
++++ src/test_override.c
+@@ -47,7 +47,7 @@ time_t time(time_t *loc)
+     return retval;
+ }
+ 
+-int gettimeofday(struct timeval *tv, struct timezone *tz)
++int gettimeofday(struct timeval *tv, void *tz)
+ {
+     tv->tv_sec = 1370546000;
+     tv->tv_usec = 123456;
diff --git a/lnav/patches/patch-src_third-party_rapidyaml_ryml__all.hpp b/lnav/patches/patch-src_third-party_rapidyaml_ryml__all.hpp
new file mode 100644
index 0000000000..e3b2e39ada
--- /dev/null
+++ b/lnav/patches/patch-src_third-party_rapidyaml_ryml__all.hpp
@@ -0,0 +1,25 @@
+$NetBSD: patch-src_third-party_rapidyaml_ryml__all.hpp,v 1.2 2023/01/17 10:18:33 wiz Exp $
+
+Add NetBSD support.
+https://github.com/tstack/lnav/pull/1106
+
+--- src/third-party/rapidyaml/ryml_all.hpp.orig	2025-02-12 19:26:00.000000000 +0000
++++ src/third-party/rapidyaml/ryml_all.hpp
+@@ -346,7 +346,7 @@ C4_FOR_EACH(PRN_STRUCT_OFFSETS, a, b, c)
+ #elif defined(__linux__) || defined(__linux)
+ #   define C4_UNIX
+ #   define C4_LINUX
+-#elif defined(__unix__) || defined(__unix)
++#elif defined(__unix__) || defined(__unix) || defined(__NetBSD__)
+ #   define C4_UNIX
+ #elif defined(__arm__) || defined(__aarch64__)
+ #   define C4_ARM
+@@ -356,7 +356,7 @@ C4_FOR_EACH(PRN_STRUCT_OFFSETS, a, b, c)
+ #   error "unknown platform"
+ #endif
+ 
+-#if defined(__posix) || defined(C4_UNIX) || defined(C4_LINUX)
++#if defined(__posix) || defined(C4_UNIX) || defined(C4_LINUX) || defined(__NetBSD__)
+ #   define C4_POSIX
+ #endif
+ 
diff --git a/lnav/patches/patch-src_vtab__module.hh b/lnav/patches/patch-src_vtab__module.hh
new file mode 100644
index 0000000000..ec7efb5f76
--- /dev/null
+++ b/lnav/patches/patch-src_vtab__module.hh
@@ -0,0 +1,23 @@
+$NetBSD: patch-src_vtab__module.hh,v 1.1 2023/05/24 22:42:53 he Exp $
+
+Fix mismatch between format and data type.
+
+--- src/vtab_module.hh.orig	2022-09-20 04:05:51.000000000 +0000
++++ src/vtab_module.hh
+@@ -456,14 +456,14 @@ struct sqlite_func_adapter<Return (*)(Ar
+             if (OPT_COUNT == 0) {
+                 snprintf(buffer,
+                          sizeof(buffer),
+-                         "%s() expects exactly %ld argument%s",
++                         "%s() expects exactly %u argument%s",
+                          fd->fd_help.ht_name,
+                          REQ_COUNT,
+                          REQ_COUNT == 1 ? "s" : "");
+             } else {
+                 snprintf(buffer,
+                          sizeof(buffer),
+-                         "%s() expects between %ld and %ld arguments",
++                         "%s() expects between %u and %u arguments",
+                          fd->fd_help.ht_name,
+                          REQ_COUNT,
+                          REQ_COUNT + OPT_COUNT);



Home | Main Index | Thread Index | Old Index