add crash.log
This commit is contained in:
parent
09ab11ef01
commit
a164939161
12
main.go
12
main.go
@ -11,6 +11,7 @@ import (
|
|||||||
backend "rwkv-runner/backend-golang"
|
backend "rwkv-runner/backend-golang"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/v2"
|
"github.com/wailsapp/wails/v2"
|
||||||
|
wailsLogger "github.com/wailsapp/wails/v2/pkg/logger"
|
||||||
"github.com/wailsapp/wails/v2/pkg/options"
|
"github.com/wailsapp/wails/v2/pkg/options"
|
||||||
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
|
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
|
||||||
"github.com/wailsapp/wails/v2/pkg/options/windows"
|
"github.com/wailsapp/wails/v2/pkg/options/windows"
|
||||||
@ -66,7 +67,10 @@ var midiAssets embed.FS
|
|||||||
var components embed.FS
|
var components embed.FS
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
dev := true
|
||||||
if buildInfo, ok := debug.ReadBuildInfo(); !ok || strings.Contains(buildInfo.String(), "-ldflags") {
|
if buildInfo, ok := debug.ReadBuildInfo(); !ok || strings.Contains(buildInfo.String(), "-ldflags") {
|
||||||
|
dev = false
|
||||||
|
|
||||||
backend.CopyEmbed(assets)
|
backend.CopyEmbed(assets)
|
||||||
os.RemoveAll("./py310/Lib/site-packages/cyac-1.7.dist-info")
|
os.RemoveAll("./py310/Lib/site-packages/cyac-1.7.dist-info")
|
||||||
backend.CopyEmbed(cyac)
|
backend.CopyEmbed(cyac)
|
||||||
@ -94,6 +98,13 @@ func main() {
|
|||||||
app.HasConfigData = false
|
app.HasConfigData = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var logger wailsLogger.Logger
|
||||||
|
if dev {
|
||||||
|
logger = wailsLogger.NewDefaultLogger()
|
||||||
|
} else {
|
||||||
|
logger = wailsLogger.NewFileLogger("crash.log")
|
||||||
|
}
|
||||||
|
|
||||||
// Create application with options
|
// Create application with options
|
||||||
err = wails.Run(&options.App{
|
err = wails.Run(&options.App{
|
||||||
Title: "RWKV-Runner",
|
Title: "RWKV-Runner",
|
||||||
@ -115,6 +126,7 @@ func main() {
|
|||||||
Bind: []any{
|
Bind: []any{
|
||||||
app,
|
app,
|
||||||
},
|
},
|
||||||
|
Logger: logger,
|
||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user