Improve logging (#2)

Reviewed-on: #2
This commit is contained in:
2025-07-24 15:30:33 +00:00
parent 71f044e6e0
commit bc80ca2c9c
22 changed files with 411 additions and 307 deletions

16
main.go
View File

@@ -1,7 +1,7 @@
package main
import (
"epochsilicon/pkg/debug"
"epochsilicon/pkg/log"
"epochsilicon/pkg/service"
"epochsilicon/pkg/ui"
"epochsilicon/pkg/utils"
@@ -10,9 +10,11 @@ import (
"strings"
)
const appVersion = "1.0.0"
const appVersion = "1.0.1"
func main() {
log.SetupLogging()
PEApp := app.NewWithID("com.burkey.epochsilicon")
PEWindow := PEApp.NewWindow("EpochSilicon v" + appVersion)
PEWindow.Resize(fyne.NewSize(650, 500))
@@ -22,21 +24,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.Debugf("Failed to check for updates: %v", err)
return
}
if !updateAvailable {
debug.Printf("No updates available")
log.Debugf("No updates available")
return
}
latestVersion := strings.TrimPrefix(updateInfo.TagName, "v")
debug.Printf("Update available: current=%s, latest=%s", appVersion, latestVersion)
log.Debugf("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.Debugf("Update suppressed by user: %s", latestVersion)
return
}
@@ -49,7 +51,7 @@ func main() {
// Set up cleanup when window closes
PEWindow.SetCloseIntercept(func() {
debug.Println("Application closing, cleaning up RosettaX87 service...")
log.Debug("Application closing, cleaning up RosettaX87 service...")
service.CleanupService()
PEApp.Quit()
})