Add support for production log levels (#1555)

This commit is contained in:
Lea Anthony
2022-07-14 21:45:13 +10:00
committed by GitHub
parent 77db50a76a
commit f068c33dcf
4 changed files with 54 additions and 46 deletions
+5 -4
View File
@@ -7,10 +7,11 @@ import (
// Default options for creating the App
var Default = &App{
Width: 1024,
Height: 768,
Logger: logger.NewDefaultLogger(),
LogLevel: logger.INFO,
Width: 1024,
Height: 768,
Logger: logger.NewDefaultLogger(),
LogLevel: logger.INFO,
LogLevelProduction: logger.ERROR,
}
var defaultMacMenu = menu.NewMenuFromItems(
+13 -12
View File
@@ -43,18 +43,19 @@ type App struct {
AlwaysOnTop bool
BackgroundColour *RGBA
// RGBA is deprecated. Please use BackgroundColour
RGBA *RGBA
Assets fs.FS
AssetsHandler http.Handler
Menu *menu.Menu
Logger logger.Logger `json:"-"`
LogLevel logger.LogLevel
OnStartup func(ctx context.Context) `json:"-"`
OnDomReady func(ctx context.Context) `json:"-"`
OnShutdown func(ctx context.Context) `json:"-"`
OnBeforeClose func(ctx context.Context) (prevent bool) `json:"-"`
Bind []interface{}
WindowStartState WindowStartState
RGBA *RGBA
Assets fs.FS
AssetsHandler http.Handler
Menu *menu.Menu
Logger logger.Logger `json:"-"`
LogLevel logger.LogLevel
LogLevelProduction logger.LogLevel
OnStartup func(ctx context.Context) `json:"-"`
OnDomReady func(ctx context.Context) `json:"-"`
OnShutdown func(ctx context.Context) `json:"-"`
OnBeforeClose func(ctx context.Context) (prevent bool) `json:"-"`
Bind []interface{}
WindowStartState WindowStartState
//ContextMenus []*menu.ContextMenu
//TrayMenus []*menu.TrayMenu