Skip to content

feat(logs): Export logs, click to copy, and a clearer log table - #567

Open
Tekunalogy wants to merge 3 commits into
mainfrom
feat/log-export
Open

Tekunalogy wants to merge 3 commits into
mainfrom
feat/log-export

Conversation

@Tekunalogy

@Tekunalogy Tekunalogy commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

What

  • Export button (next to refresh): downloads every log the backend has as dweos-logs-<local time>.csv, with columns Date, Time, Level, Logger, File, Line, Function, Message (RFC 4180 quoting, UTF-8 BOM for Excel)
  • Click a row to copy it: copies the whole log (all columns) as <timestamp> <LEVEL> [<logger>] <file>:<line> <function>(): with the message on the next line, with a toast and a brief row highlight. dweOS is usually opened over plain HTTP, where navigator.clipboard doesn't exist, so it falls back to execCommand("copy") like the terminal does.
  • Table layout:
    • Separate Date and Time (with milliseconds) columns, and fixed-width level badges, with matching gaps between them
    • The message column takes the remaining width (it was capped at 150px)
    • A message cut off by the two-line clamp shows the full text in a callout on hover
  • Removed the log detail dialog: it was 30% opaque and mostly duplicated the row; the tour step now says to click a log to copy it.

No backend changes: the frontend already loads every log from /api/logs. "All logs" covers logs since the last dweOS start, not the rotated log files on disk.

Testing

  • Throwaway script for the copy format, CSV quoting (commas, quotes, newlines), timestamp split, and file name
  • eslint, tsc -b, npm run build
  • In a browser against a fake backend: row copy from any cell (exact line, flash, no dialog), the plain-HTTP copy fallback, the hover callout only on truncated messages, export (all 39 logs)
  • On a Pi over plain HTTP

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Preview build: preview-pr-567 (v0.7.7-pr567.f813390)

curl -s https://raw.githubusercontent.com/DeepWaterExploration/dweOS/main/install.sh | sudo bash -s preview-pr-567

Rebuilt on every push. Closing this pull request deletes the preview.

@Tekunalogy Tekunalogy changed the title feat(logs): Export and copy logs, and make the log detail readable feat(logs): Export logs, click to copy, and a clearer log table Oct 15, 2026
@Tekunalogy Tekunalogy self-assigned this Oct 15, 2026
@Tekunalogy
Tekunalogy requested a review from brandonhs October 15, 2026 04:11
@Tekunalogy Tekunalogy added the enhancement New feature or request label Oct 15, 2026
@Tekunalogy
Tekunalogy marked this pull request as ready for review October 15, 2026 04:13
Tekunalogy and others added 3 commits October 14, 2026 21:18
An Export button next to refresh downloads every log the backend holds as
dweos-logs-<time>.csv, with date, time, level, logger, file, line,
function and message columns, RFC 4180 quoting, and a BOM so Excel reads
it as UTF-8.

The shared helpers in lib/util/logs.ts also cover copying a log, which
falls back to execCommand("copy") because dweOS is usually opened over
plain HTTP, where navigator.clipboard isn't available.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Clicking anywhere on a row copies the whole log, with the message on its
own line after the timestamp, level, logger and source. The row uses a
pointer cursor and briefly highlights as feedback.

The log detail dialog is removed: it was 30% opaque over the table and
mostly repeated the row. The tour's logs step now explains the click to
copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Separate Date and Time (with milliseconds) columns.
- The date, time and level columns are sized to their fixed-width
  contents, and level badges share one width, so the gaps line up on
  every row.
- The message column takes the remaining width instead of being capped
  at 150px; a message cut off by the two-line clamp shows the full text
  in a callout on hover.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brandonhs

Copy link
Copy Markdown
Member
image

Long messages are truncated without means to view besides a zoom-out or copy-paste. This is why there was a dialog box before.

@brandonhs

Copy link
Copy Markdown
Member

Looks like I missed the hover-over -> callout for viewing longer messages. Seems acceptable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants