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

View File

@@ -1,8 +1,8 @@
package paths
import (
"epochsilicon/pkg/log"
"fmt"
"log"
"os"
"path/filepath"
@@ -33,7 +33,7 @@ func SelectCrossOverPath(myWindow fyne.Window, crossoverPathLabel *widget.RichTe
return
}
if uri == nil {
log.Println("CrossOver path selection cancelled.")
log.Info("CrossOver path selection cancelled.")
updateAllStatuses()
return
}
@@ -41,14 +41,14 @@ func SelectCrossOverPath(myWindow fyne.Window, crossoverPathLabel *widget.RichTe
if filepath.Ext(selectedPath) == ".app" && utils.DirExists(selectedPath) {
CrossoverPath = selectedPath
PatchesAppliedCrossOver = false
log.Println("CrossOver path set to:", CrossoverPath)
log.Infof("CrossOver path set to:", CrossoverPath)
// Save to prefs
prefs, _ := utils.LoadPrefs()
prefs.CrossOverPath = selectedPath
utils.SavePrefs(prefs)
} else {
dialog.ShowError(fmt.Errorf("invalid selection: '%s'. Please select a valid .app bundle", selectedPath), myWindow)
log.Println("Invalid CrossOver path selected:", selectedPath)
log.Infof("Invalid CrossOver path selected:", selectedPath)
}
updateAllStatuses()
}, myWindow)
@@ -61,7 +61,7 @@ func SelectEpochPath(myWindow fyne.Window, epochPathLabel *widget.RichText, upda
return
}
if uri == nil {
log.Println("Epoch path selection cancelled.")
log.Info("Epoch path selection cancelled.")
updateAllStatuses()
return
}
@@ -69,14 +69,14 @@ func SelectEpochPath(myWindow fyne.Window, epochPathLabel *widget.RichText, upda
if utils.DirExists(selectedPath) {
EpochPath = selectedPath
PatchesAppliedEpoch = false
log.Println("Epoch path set to:", EpochPath)
log.Infof("Epoch path set to:", EpochPath)
// Save to prefs
prefs, _ := utils.LoadPrefs()
prefs.EpochPath = selectedPath
utils.SavePrefs(prefs)
} else {
dialog.ShowError(fmt.Errorf("invalid selection: '%s' is not a valid directory", selectedPath), myWindow)
log.Println("Invalid Epoch path selected:", selectedPath)
log.Infof("Invalid Epoch path selected:", selectedPath)
}
updateAllStatuses()
}, myWindow)
@@ -102,7 +102,7 @@ func CheckDefaultCrossOverPath() {
if CrossoverPath == "" {
if info, err := os.Stat(DefaultCrossOverPath); err == nil && info.IsDir() {
CrossoverPath = DefaultCrossOverPath
log.Println("Pre-set CrossOver to default:", DefaultCrossOverPath)
log.Infof("Pre-set CrossOver to default:", DefaultCrossOverPath)
}
}
}