5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-04 16:40:41 +08:00
wails/v3/pkg/application/logger_windows.go

20 lines
375 B
Go

//go:build windows
package application
import (
"github.com/lmittmann/tint"
"github.com/mattn/go-colorable"
"github.com/mattn/go-isatty"
"log/slog"
"os"
"time"
)
func DefaultLogger() *slog.Logger {
return slog.New(tint.NewHandler(colorable.NewColorable(os.Stderr), &tint.Options{
TimeFormat: time.Kitchen,
NoColor: !isatty.IsTerminal(os.Stderr.Fd()),
}))
}