Skip to content

[log2src] use the log levels of statements - #1762

Merged
tstack merged 5 commits into
masterfrom
claude/project-thread-dj3xkq
Oct 26, 2026
Merged

tstack merged 5 commits into
masterfrom
claude/project-thread-dj3xkq

Conversation

@tstack

@tstack tstack commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Requested by Tim · project thread

Updates lnav for log2src's new per-statement log levels (tstack/log2src#2). Those levels reached caching1 through tstack/log2src#3, which is now merged, so lnav-rs-ext is back on branch = "caching1" and its lockfile is pinned to 6c6ebcc.

Changes

  • find_log_statement() and find_log_statement_json() now take the message's level. This lets log2src prefer a statement with the same level when several match equally well. lnav's level names map onto log2src's:

    • debug2–debug5 become debug
    • stats becomes info
    • unknown, invalid, and header pass no level

    The callers that pass the line's level are all_logs, log_stmt_stats (both matching and sampling), and log_data_helper.

  • FindLogResult has a level field. source_log_stmt() has a new level column after block_id, which uses lnav's level names and is NULL when log2src couldn't tell, as with a printf().

  • The level is not added to log_msg_src, so log_msg_schema hashes don't change.

  • I regenerated the cxx bridge files with cxxbridge 1.0.205, the same version as the lockfile.

  • I added a NEWS entry.

Tests

  • test_log2src.sh now selects level from source_log_stmt(). The new expected output shows these levels:

    • Python: debug, info, warning, error
    • Java: info, debug, warning, error

    I removed the old expected files for those commands.

  • I updated the expected log_msg_format from (.+) to (.*). That change comes from the previous log2src bump, which lets placeholders be empty; master's expected output hadn't caught up yet.

  • test_cmds.sh: the help output now includes the new column.

  • Local autotools build: test_cmds.sh passes. test_log2src.sh shows only two diffs, and both come from the sandbox: a permission-denied check that doesn't fail when running as root, and a stack-frame path under /home/user that gets rewritten to {top_srcdir_parent}.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KTECZJ1AReK76iN7tgD1KY

log2src now gives each statement the level of its logging call.  The
message's level is passed along when looking for its statement, so a
statement with the same level wins a tie, and source_log_stmt() has a
new level column.

lnav-rs-ext points at the log2src branch that brings the levels into
caching1 until that is merged.  The expected output for the patterns
that now allow empty values, from the previous log2src update, is
updated too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KTECZJ1AReK76iN7tgD1KY
@tstack tstack self-assigned this Oct 26, 2026

tstack commented Oct 26, 2026

Copy link
Copy Markdown
Owner Author

markdown-link-check is failing on external links this PR doesn't touch. The failing links are cr.yp.to/libtai in an old NEWS entry (status 0), justine.lol/ape.html (403), coveralls (403), about.signpath.io (status 0), a news.ycombinator.com item (419), and lopes.id/2023-lnav-test/ (404). The NEWS lines this PR adds have no links. I don't have a fix for those sites, so I've re-run the job once and left the links alone.


Generated by Claude Code

@tstack
tstack merged commit a6a4890 into master Oct 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants