Skip to content

Comments

Add open debug log file button in Settings#2649

Open
bcotrim wants to merge 10 commits intotrunkfrom
stu-1311-open-debug-logs-from-ui
Open

Add open debug log file button in Settings#2649
bcotrim wants to merge 10 commits intotrunkfrom
stu-1311-open-debug-logs-from-ui

Conversation

@bcotrim
Copy link
Contributor

@bcotrim bcotrim commented Feb 23, 2026

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 Add open debug log file button in Settings Feb 24, 2026
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Feb 24, 2026

📊 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)

Copy link
Contributor

@ivan-ottinger ivan-ottinger left a comment

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
Copy link
Contributor

wojtekn commented Feb 24, 2026

@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.

Copy link
Contributor

@ivan-ottinger ivan-ottinger left a comment

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
Copy link
Contributor Author

bcotrim commented Feb 24, 2026

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
Copy link
Contributor Author

bcotrim commented Feb 24, 2026

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

image

@wojtekn
Copy link
Contributor

wojtekn commented Feb 24, 2026

@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
Copy link
Contributor Author

bcotrim commented Feb 24, 2026

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!

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.

4 participants