diff --git a/v2/test/kitchensink/frontend/src/App.svelte b/v2/test/kitchensink/frontend/src/App.svelte index b89f54ce..866ac69a 100644 --- a/v2/test/kitchensink/frontend/src/App.svelte +++ b/v2/test/kitchensink/frontend/src/App.svelte @@ -1,19 +1,12 @@ -
+
- Title - - Go - - - + {title} + + Go + + + + - + {#if description} +
{description}
+ {/if} +
+
+
+ {showCode?'▼':'▶'} + Example Code +
+ {#if showCode} + + {/if} +
+ +
+
+ {showRun?'▼':'▶'} + Try Me! +
+ {#if showRun} +
+ +
+ {/if}
- {#if !hidden} - - {/if}
\ No newline at end of file diff --git a/v2/test/kitchensink/frontend/src/pages/Events.svelte b/v2/test/kitchensink/frontend/src/pages/Events.svelte index adb3e040..f7ccdf9d 100644 --- a/v2/test/kitchensink/frontend/src/pages/Events.svelte +++ b/v2/test/kitchensink/frontend/src/pages/Events.svelte @@ -7,11 +7,16 @@

Events

- Events are...... + Wails includes a unified events system which allows you to do the following in either Go or Javascript: -
Try Me
-
- + + +
\ No newline at end of file diff --git a/v2/test/kitchensink/frontend/src/pages/logging/code.go b/v2/test/kitchensink/frontend/src/pages/logging/code.go index d5ec51cb..45b0e636 100644 --- a/v2/test/kitchensink/frontend/src/pages/logging/code.go +++ b/v2/test/kitchensink/frontend/src/pages/logging/code.go @@ -1,42 +1,19 @@ package main -import ( - wails "github.com/wailsapp/wails/v2" -) +import wails "github.com/wailsapp/wails/v2" -// Logger struct -type Logger struct { +type MyStruct struct { runtime *wails.Runtime } -// WailsInit is called at application startup -func (l *Logger) WailsInit(runtime *wails.Runtime) error { - // Perform your setup here +func (l *MyStruct) WailsInit(runtime *wails.Runtime) error { + + runtime.Log.Debug(message) + runtime.Log.Info(message) + runtime.Log.Warning(message) + runtime.Log.Error(message) + runtime.Log.Fatal(message) + l.runtime = runtime return nil } - -// Debug will log the given message -func (l *Logger) Debug(message string) { - l.runtime.Log.Debug(message) -} - -// Info will log the given message -func (l *Logger) Info(message string) { - l.runtime.Log.Info(message) -} - -// Warning will log the given message -func (l *Logger) Warning(message string) { - l.runtime.Log.Warning(message) -} - -// Error will log the given message -func (l *Logger) Error(message string) { - l.runtime.Log.Error(message) -} - -// Fatal will log the given message -func (l *Logger) Fatal(message string) { - l.runtime.Log.Fatal(message) -} diff --git a/v2/test/kitchensink/frontend/src/pages/logging/code.jsx b/v2/test/kitchensink/frontend/src/pages/logging/code.jsx index ade1ad0b..eb9b4a24 100644 --- a/v2/test/kitchensink/frontend/src/pages/logging/code.jsx +++ b/v2/test/kitchensink/frontend/src/pages/logging/code.jsx @@ -1,18 +1,15 @@ - import { Log } from '@wailsapp/runtime2'; function doSomeOperation() { - // Do things - let value = doSomething(); - Log.Debug("I got: " + value); - /* - Log.Info("An Info message"); - Log.Warning("A Warning message"); - Log.Error("An Error message"); - */ + // Do things + let value = doSomething(); + Log.Debug("I got: " + value); + Log.Info("An Info message"); + Log.Warning("A Warning message"); + Log.Error("An Error message"); } function abort() { - // Do some things - Log.Fatal("I accidentally the whole application!"); + // Do some things + Log.Fatal("I accidentally the whole application!"); } \ No newline at end of file