mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 22:55:48 +01:00
[windows] Fix production logger. Add alpha assets
This commit is contained in:
parent
f07e4093be
commit
83ed7fd2df
2 changed files with 95 additions and 2 deletions
|
|
@ -1,7 +1,9 @@
|
|||
package application
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"log"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
|
|
@ -23,8 +25,16 @@ import (
|
|||
"github.com/wailsapp/wails/v3/pkg/events"
|
||||
)
|
||||
|
||||
//go:embed assets/*
|
||||
var alphaAssets embed.FS
|
||||
|
||||
var globalApplication *App
|
||||
|
||||
// AlphaAssets is the default assets for the alpha application
|
||||
var AlphaAssets = AssetOptions{
|
||||
FS: alphaAssets,
|
||||
}
|
||||
|
||||
func init() {
|
||||
runtime.LockOSThread()
|
||||
}
|
||||
|
|
@ -47,8 +57,12 @@ func New(appOptions Options) *App {
|
|||
result := newApplication(appOptions)
|
||||
globalApplication = result
|
||||
|
||||
if result.isDebugMode && result.Logger == nil {
|
||||
result.Logger = DefaultLogger(result.options.LogLevel)
|
||||
if result.Logger == nil {
|
||||
if result.isDebugMode {
|
||||
result.Logger = DefaultLogger(result.options.LogLevel)
|
||||
} else {
|
||||
result.Logger = slog.New(slog.NewTextHandler(io.Discard, nil))
|
||||
}
|
||||
}
|
||||
|
||||
result.logStartup()
|
||||
|
|
|
|||
79
v3/pkg/application/assets/alpha/index.html
Normal file
79
v3/pkg/application/assets/alpha/index.html
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue