change to zerolog

This commit is contained in:
2025-07-23 08:46:53 -07:00
parent 71f044e6e0
commit 8b5be228fe
17 changed files with 223 additions and 222 deletions

View File

@@ -1,11 +1,11 @@
package ui
import (
"github.com/rs/zerolog/log"
"net/url"
"strings"
"time"
"epochsilicon/pkg/debug"
"epochsilicon/pkg/launcher"
"epochsilicon/pkg/patching"
"epochsilicon/pkg/service"
@@ -27,7 +27,7 @@ func createOptionsComponents() {
prefs, _ := utils.LoadPrefs()
prefs.EnableMetalHud = checked
utils.SavePrefs(prefs)
debug.Printf("Metal HUD enabled: %v", launcher.EnableMetalHud)
log.Debug().Msgf("Metal HUD enabled: %v", launcher.EnableMetalHud)
})
metalHudCheckbox.SetChecked(prefs.EnableMetalHud)
launcher.EnableMetalHud = prefs.EnableMetalHud
@@ -37,7 +37,7 @@ func createOptionsComponents() {
prefs, _ := utils.LoadPrefs()
prefs.ShowTerminalNormally = checked
utils.SavePrefs(prefs)
debug.Printf("Show terminal normally: %v", checked)
log.Debug().Msgf("Show terminal normally: %v", checked)
})
showTerminalCheckbox.SetChecked(prefs.ShowTerminalNormally)
@@ -47,7 +47,7 @@ func createOptionsComponents() {
prefs, _ := utils.LoadPrefs()
prefs.AutoDeleteWdb = checked
utils.SavePrefs(prefs)
debug.Printf("Auto-delete WDB enabled: %v", launcher.AutoDeleteWdb)
log.Debug().Msgf("Auto-delete WDB enabled: %v", launcher.AutoDeleteWdb)
})
autoDeleteWdbCheckbox.SetChecked(prefs.AutoDeleteWdb)
launcher.AutoDeleteWdb = prefs.AutoDeleteWdb
@@ -69,7 +69,7 @@ func createOptionsComponents() {
prefs, _ := utils.LoadPrefs()
prefs.EnvironmentVariables = text
utils.SavePrefs(prefs)
debug.Printf("Environment variables updated: %v", launcher.CustomEnvVars)
log.Debug().Msgf("Environment variables updated: %v", launcher.CustomEnvVars)
}
}
@@ -126,7 +126,7 @@ func createBottomBar(myWindow fyne.Window) fyne.CanvasObject {
githubURL := "https://git.burkey.co/eburk/epochsilicon"
parsedURL, err := url.Parse(githubURL)
if err != nil {
debug.Printf("Error parsing git URL: %v", err)
log.Debug().Msgf("Error parsing git URL: %v", err)
return
}
fyne.CurrentApp().OpenURL(parsedURL)
@@ -198,7 +198,7 @@ func createWineRegistryComponents() {
}()
if err := utils.SetOptionAsAltEnabled(true); err != nil {
debug.Printf("Failed to enable Option-as-Alt mapping: %v", err)
log.Debug().Msgf("Failed to enable Option-as-Alt mapping: %v", err)
// Update UI on main thread
fyne.Do(func() {
stopPulsingEffect()
@@ -206,7 +206,7 @@ func createWineRegistryComponents() {
})
time.Sleep(2 * time.Second) // Show error briefly
} else {
debug.Printf("Successfully enabled Option-as-Alt mapping")
log.Debug().Msgf("Successfully enabled Option-as-Alt mapping")
// Update preferences
prefs, _ := utils.LoadPrefs()
prefs.RemapOptionAsAlt = true
@@ -240,7 +240,7 @@ func createWineRegistryComponents() {
}()
if err := utils.SetOptionAsAltEnabled(false); err != nil {
debug.Printf("Failed to disable Option-as-Alt mapping: %v", err)
log.Debug().Msgf("Failed to disable Option-as-Alt mapping: %v", err)
// Update UI on main thread
fyne.Do(func() {
stopPulsingEffect()
@@ -248,7 +248,7 @@ func createWineRegistryComponents() {
})
time.Sleep(2 * time.Second) // Show error briefly
} else {
debug.Printf("Successfully disabled Option-as-Alt mapping")
log.Debug().Msgf("Successfully disabled Option-as-Alt mapping")
// Update preferences
prefs, _ := utils.LoadPrefs()
prefs.RemapOptionAsAlt = false

View File

@@ -1,8 +1,8 @@
package ui
import (
"epochsilicon/pkg/debug"
"epochsilicon/pkg/paths"
"github.com/rs/zerolog/log"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/canvas"
@@ -34,7 +34,7 @@ func createLogoContainer() fyne.CanvasObject {
// Load the application logo
logoResource, err := fyne.LoadResourceFromPath("Icon.png")
if err != nil {
debug.Printf("Warning: could not load logo: %v", err)
log.Debug().Msgf("Warning: could not load logo: %v", err)
}
// Create the logo image with a smaller fixed size since we have a header now

View File

@@ -1,8 +1,8 @@
package ui
import (
"epochsilicon/pkg/debug"
"git.burkey.co/eburk/epochcli/pkg/epoch"
"github.com/rs/zerolog/log"
"os"
"path/filepath"
"strings"
@@ -110,10 +110,10 @@ func updateEpochStatus() {
epochPatchesApplied := false
stats, err := epoch.Update(paths.EpochPath, false, true, true)
if err != nil {
debug.Printf("Failed to get download Epoch patches: %v", err)
log.Debug().Msgf("Failed to get download Epoch patches: %v", err)
}
if stats.Outdated == 0 {
debug.Println("Nothing is outdated")
log.Debug().Msg("Nothing is outdated")
epochPatchesApplied = true
}

View File

@@ -2,10 +2,10 @@ package ui
import (
"fmt"
"github.com/rs/zerolog/log"
"strings"
"time"
"epochsilicon/pkg/debug"
"epochsilicon/pkg/utils"
"fyne.io/fyne/v2"
@@ -105,7 +105,7 @@ func ShowUpdateDialog(updateInfo *utils.UpdateInfo, currentVersion string, myWin
if err != nil {
progressLabel.SetText(fmt.Sprintf("Download failed: %v", err))
debug.Printf("Download failed: %v", err)
log.Debug().Msgf("Download failed: %v", err)
// Re-enable close button
d.SetButtons([]fyne.CanvasObject{
@@ -123,7 +123,7 @@ func ShowUpdateDialog(updateInfo *utils.UpdateInfo, currentVersion string, myWin
err = utils.InstallUpdate(downloadPath)
if err != nil {
progressLabel.SetText(fmt.Sprintf("Installation failed: %v", err))
debug.Printf("Installation failed: %v", err)
log.Debug().Msgf("Installation failed: %v", err)
// Re-enable close button
fyne.DoAndWait(func() {