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

17
main.go
View File

@@ -1,17 +1,22 @@
package main
import (
"epochsilicon/pkg/debug"
"epochsilicon/pkg/service"
"epochsilicon/pkg/ui"
"epochsilicon/pkg/utils"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"strings"
)
const appVersion = "1.0.0"
func init() {
zerolog.TimeFieldFormat = zerolog.TimeFormatUnix
}
func main() {
PEApp := app.NewWithID("com.burkey.epochsilicon")
PEWindow := PEApp.NewWindow("EpochSilicon v" + appVersion)
@@ -22,21 +27,21 @@ func main() {
prefs, _ := utils.LoadPrefs()
updateInfo, updateAvailable, err := utils.CheckForUpdateWithAssets(appVersion)
if err != nil {
debug.Printf("Failed to check for updates: %v", err)
log.Debug().Msgf("Failed to check for updates: %v", err)
return
}
if !updateAvailable {
debug.Printf("No updates available")
log.Debug().Msgf("No updates available")
return
}
latestVersion := strings.TrimPrefix(updateInfo.TagName, "v")
debug.Printf("Update available: current=%s, latest=%s", appVersion, latestVersion)
log.Debug().Msgf("Update available: current=%s, latest=%s", appVersion, latestVersion)
// Skip if user has suppressed this version
if prefs.SuppressedUpdateVersion == latestVersion {
debug.Printf("Update suppressed by user: %s", latestVersion)
log.Debug().Msgf("Update suppressed by user: %s", latestVersion)
return
}
@@ -49,7 +54,7 @@ func main() {
// Set up cleanup when window closes
PEWindow.SetCloseIntercept(func() {
debug.Println("Application closing, cleaning up RosettaX87 service...")
log.Debug().Msg("Application closing, cleaning up RosettaX87 service...")
service.CleanupService()
PEApp.Quit()
})