mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 05:11:29 +08:00

* Tidy up runtime JS * Initial implementation of runtime over http * Update runtime deps. Fix test task. * Support Clipboard. Message Processor refactor. * Add `Window.Screen()` Clipboard `GetText` -> `Text` * Support most dialogs Better JS->Go object mapping Implement Go->JS callback mechanism Rename `window.runtime` -> `window.wails` to better reflect the Go API * Support SaveFile dialog * Remove go.work * Tidy up * Event->CustomEvent to prevent potential clash with native JS Event object Support Eventing * Support application calls * Support logging * Support named windows Remove debug info * Update v3 changes
28 lines
482 B
Go
28 lines
482 B
Go
package logger
|
|
|
|
import "fmt"
|
|
|
|
type Console struct{}
|
|
|
|
func (l *Console) Name() string {
|
|
return "Console"
|
|
}
|
|
|
|
func (l *Console) Log(message *Message) {
|
|
msg := fmt.Sprintf(message.Message+"\n", message.Data...)
|
|
level := ""
|
|
if message.Level != "" {
|
|
level = fmt.Sprintf("[%s] ", message.Level)
|
|
}
|
|
sender := ""
|
|
if message.Sender != "" {
|
|
sender = fmt.Sprintf("%s: ", message.Sender)
|
|
}
|
|
|
|
fmt.Printf("%s%s%s", level, sender, msg)
|
|
}
|
|
|
|
func (l *Console) Flush() error {
|
|
return nil
|
|
}
|