fix: use structured logging for debug/info methods#4767
fix: use structured logging for debug/info methods#4767leaanthony merged 10 commits intov3-alphafrom
Conversation
The debug() and info() methods were using fmt.Sprintf() which expects printf-style format directives, but callers were using slog-style key-value pairs. Changed to pass args directly to Logger.Debug/Info which properly handles structured logging. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Deploying wails with
|
| Latest commit: |
ed39497
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://db01592d.wails.pages.dev |
| Branch Preview URL: | https://fix-build-errors.wails.pages.dev |
WalkthroughReplaces many ad-hoc fmt.* debug prints with structured logging or removals, adds NVIDIA/Wayland startup handling and Linux NVIDIA driver detection, adds an iOS Go build constraint, updates the unreleased changelog, and removes a submodule pointer. No exported/public API signatures changed. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧠 Learnings (2)📓 Common learnings📚 Learning: 2025-10-17T23:16:11.570ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
🔇 Additional comments (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
v3/UNRELEASED_CHANGELOG.md(1 hunks)v3/pkg/application/application.go(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: fbbdev
Repo: wailsapp/wails PR: 4066
File: v3/pkg/application/messageprocessor_call.go:174-174
Timestamp: 2025-02-13T01:05:02.267Z
Learning: When handling JSON marshaling errors in Wails v3, the error message from json.Marshal provides sufficient debugging context. Logging raw data is unnecessary and could make logs harder to read.
🧬 Code graph analysis (1)
v3/pkg/application/application.go (1)
v3/pkg/services/log/log.go (2)
Info(20-20)Debug(19-19)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Run Go Tests v3 (macos-latest, 1.24)
- GitHub Check: Run Go Tests v3 (windows-latest, 1.24)
- GitHub Check: Run Go Tests v3 (ubuntu-latest, 1.24)
- GitHub Check: Analyze (go)
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: Cloudflare Pages
🔇 Additional comments (1)
v3/UNRELEASED_CHANGELOG.md (1)
26-27: LGTM!The changelog entries accurately document the fixes in this PR and follow the established format.
Remove emoji debug logs (🔴, 🟢, 🟠, 🔵, 🔥) that were accidentally left in from the iOS/Android mobile platform support merge. These were development debugging statements that should not have been included in the final code. Files cleaned: - application.go - application_debug.go - init_android.go - init_ios.go - mainthread_android.go - mainthread_ios.go - webview_window.go - webview_window_ios.go 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add breaking change note: production builds are now default - Add entry for debug print statement removal 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Convert three debug() calls that were still using printf-style format strings to slog-style structured logging (key-value pairs): - systemtray_windows.go: ShellNotifyIcon show/hide failures - application_darwin.go: window lookup failure This addresses CodeRabbit review feedback and ensures consistency with the refactored debug() method. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
a17f1ac to
d1fde91
Compare
Convert remaining info() calls that were using printf-style format strings to slog-style structured logging (key-value pairs): - application_ios.go: iOS log messages and HandleJSMessage calls - webview_window_windows.go: WM_SYSKEYDOWN logging - application.go: handleWindowMessage and handleWebViewRequest logging Also removed debug fmt.Printf statements from handleWebViewRequest. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
d1fde91 to
a05838d
Compare
…OS platforms Go's toolchain tries to process .m (Objective-C) files when they're in a directory with Go files. Adding a //go:build ios tag tells Go to only process this file when building for iOS, matching how darwin .m files handle this (e.g., //go:build darwin && !ios). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ef17bff to
e1106d5
Compare
The iOS merge added a submodule reference without a corresponding .gitmodules file, causing Cloudflare and other CI systems to fail with "No url found for submodule path" errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…crashes WebKitGTK has a known issue with the DMA-BUF renderer on NVIDIA proprietary drivers running Wayland, causing "Error 71 (Protocol error)" crashes. This fix automatically detects NVIDIA GPUs (via /sys/module/nvidia) and sets WEBKIT_DISABLE_DMABUF_RENDERER=1 when running on Wayland. Also removes leftover debug print statements from mobile platform merge. See: https://bugs.webkit.org/show_bug.cgi?id=262607 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Shows NVIDIA driver version and srcversion in doctor output to help diagnose Wayland/NVIDIA compatibility issues. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|



Summary
debug()andinfo()methods to pass args directly to Logger.Debug/Info instead of using fmt.Sprintf()Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
Changed
New Features
Bug Fixes
Chores
✏️ Tip: You can customize this high-level summary in your review settings.