Skip to content

Add open debug log file button in Settings - #2649

Merged
bcotrim merged 10 commits into
trunkfrom
stu-1311-open-debug-logs-from-ui
Feb 24, 2026
Merged

Add open debug log file button in Settings#2649
bcotrim merged 10 commits into
trunkfrom
stu-1311-open-debug-logs-from-ui

Conversation

@bcotrim

@bcotrim bcotrim commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

Related issues

Proposed Changes

  • Add "Open log file" button next to the debug log toggle in Settings, visible only when debug logging is enabled
  • Uses showItemInFolder to reveal the wp-content/debug.log file in the system file manager
image

Testing Instructions

  • Enable debug logging for a site (Settings > Debug log > Enabled)
  • Verify an "Open log file" link appears next to "Enabled"
  • Click the link — it should open Finder/Explorer with debug.log selected
  • Disable debug logging and verify the link disappears

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@bcotrim bcotrim self-assigned this Feb 23, 2026
@bcotrim
bcotrim marked this pull request as ready for review February 24, 2026 08:43
@bcotrim
bcotrim requested a review from a team February 24, 2026 08:44
@bcotrim bcotrim changed the title Add in-app debug log viewer Feb 24, 2026
@wpmobilebot

wpmobilebot commented Feb 24, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing f73e587 vs trunk

site-editor

Metric trunk f73e587 Diff Change
load 1465.00 ms 1456.00 ms -9.00 ms ⚪ 0.0%

site-startup

Metric trunk f73e587 Diff Change
siteCreation 7083.00 ms 8079.00 ms +996.00 ms 🔴 14.1%
siteStartup 4912.00 ms 4940.00 ms +28.00 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@ivan-ottinger ivan-ottinger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a nice shortcut! It works well when the debug.log file exists:

CleanShot.2026-02-24.at.10.35.18.mp4

But if it is missing, the link is not clickable:

CleanShot.2026-02-24.at.10.38.33.mp4

Maybe we could consider disabling it in that case.

@wojtekn

wojtekn commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

@bcotrim, it works well for me on Mac.

I was wondering what would be the best UX - e.g., if we should add "Debug log path" field below, with wp-content/debug.log value, and add a link in the form of an icon. However, the current approach is consistent with the "Trust Certificate" CTA, so it looks good.

@ivan-ottinger ivan-ottinger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for the updates, Bernardo.

I can confirm the link is not displayed anymore when the debug.log does not exist. 👍🏼

There's still a slight edge case: When the user is already on the Settings tab, the link won't appear/disappear if the debug.log is added/removed from the file system, but I think that is acceptable.

@bcotrim

bcotrim commented Feb 24, 2026

Copy link
Copy Markdown
Contributor Author

There's still a slight edge case: When the user is already on the Settings tab, the link won't appear/disappear if the debug.log is added/removed from the file system, but I think that is acceptable.

I considered it, but it would require a file watcher. To me it seems the added complexity doesn't pay considering it should be an edge case.

@bcotrim

bcotrim commented Feb 24, 2026

Copy link
Copy Markdown
Contributor Author

@wojtekn I agree that looks better! Please let me know if this is good or if you prefer the previous version.

image
@wojtekn

wojtekn commented Feb 24, 2026

Copy link
Copy Markdown
Contributor

@wojtekn I agree that looks better! Please let me know if this is good or if you prefer the previous version.

Thanks for trying that. On second thought, the file name will be the same in most cases, and your first approach was consistent with certificate nudge. What do you think?

@bcotrim

bcotrim commented Feb 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for trying that. On second thought, the file name will be the same in most cases, and your first approach was consistent with certificate nudge. What do you think?

I think the file location being always the same is a good point, it doesn't make much sense to have it here.
Going to revert it back to the initial version and deploy, thanks for the feedback!

@bcotrim
bcotrim merged commit c068072 into trunk Feb 24, 2026
9 checks passed
@bcotrim
bcotrim deleted the stu-1311-open-debug-logs-from-ui branch February 24, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants