Skip to content

feat(tui): add log panel#1329

Merged
andrinoff merged 3 commits into
floatpane:masterfrom
FromSi:feature/tui-log-panel
May 22, 2026
Merged

feat(tui): add log panel#1329
andrinoff merged 3 commits into
floatpane:masterfrom
FromSi:feature/tui-log-panel

Conversation

@FromSi
Copy link
Copy Markdown
Member

@FromSi FromSi commented May 21, 2026

What?

Added an optional in-TUI log panel enabled with --logs. The panel is backed by a small in-memory logger buffer and renders the latest log entries at the bottom of the TUI without overwriting the active view.

The main TUI layout now reserves space for the log panel when it is enabled, so the current screen receives a reduced height instead of being drawn under the logs. The visual log panel itself lives in tui/log_panel.go.

Also updated internal/loglevel so logs written through it are consistently prefixed:

  • debug:
  • verbose:
  • info:

Added make run-log, which starts Matcha with both debug logging and the in-TUI log panel enabled:

make run-log
view

Why?

While reviewing recent PRs, I noticed it was hard to observe logs cleanly in the TUI. Logs written through log.Printf or internal/loglevel could appear over the Bubble Tea screen, or required redirecting stderr to a separate file.

This gives us a simple way to inspect runtime logs directly inside Matcha while testing behavior such as TLS resumption, plugin loading, background fetches, and other debug/verbose paths.

I did not search for an existing issue for this.

Notes

This is an initial model: there is no scrolling yet, and the panel only shows the latest entries.

In the future, we can consider a mediator/multi-sink logger that writes through one logger interface to multiple targets, for example the in-memory TUI buffer, stderr, and log files.

The panel is intentionally read-only for now; keyboard handling and scrolling can be added later without changing the logger interface.

@FromSi FromSi requested a review from a team as a code owner May 21, 2026 21:36
@floatpanebot floatpanebot added area/tui Terminal UI / view layer area/i18n Localization / translations area/build Build system / Makefile / packaging enhancement New feature or request size/L Diff: 201–800 lines labels May 21, 2026
@FromSi FromSi requested a review from andrinoff May 21, 2026 21:37
@floatpanebot floatpanebot added the dependencies Dependency updates label May 21, 2026
@andrinoff andrinoff merged commit 395fc8a into floatpane:master May 22, 2026
14 checks passed
Copy link
Copy Markdown
Member

@floatpanebot floatpanebot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI workflow failed. Please fix the following issues locally and push again:

Please check the CI logs for more details on the failure.

andrinoff added a commit that referenced this pull request May 22, 2026
## What?

Changes the test assertion due to #1329 changing the output to have
`info: ` in front of it. Due to the PR not being rebased to have the
#1316 commit.

## Why?

Tests fail.

Signed-off-by: drew <me@andrinoff.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Build system / Makefile / packaging area/i18n Localization / translations area/tui Terminal UI / view layer dependencies Dependency updates enhancement New feature or request size/L Diff: 201–800 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants