mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-05 04:50:09 +08:00
20 lines
320 B
Go
20 lines
320 B
Go
//go:build !windows
|
|
|
|
package application
|
|
|
|
import (
|
|
"log/slog"
|
|
"os"
|
|
"time"
|
|
|
|
"github.com/lmittmann/tint"
|
|
"github.com/mattn/go-isatty"
|
|
)
|
|
|
|
func DefaultLogger() *slog.Logger {
|
|
return slog.New(tint.NewHandler(os.Stderr, &tint.Options{
|
|
TimeFormat: time.Kitchen,
|
|
NoColor: !isatty.IsTerminal(os.Stderr.Fd()),
|
|
}))
|
|
}
|