summaryrefslogtreecommitdiff
path: root/cmd/termpicker/main.go
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2024-11-24 02:59:00 -0500
committerBenjamin Chausse <benjamin@chausse.xyz>2024-11-24 02:59:00 -0500
commitac024fff3ce70b435a39de83f7aa3339668fdc6b (patch)
tree2e68d5d6c3517770fc8bae1da3e70f53a241e7e3 /cmd/termpicker/main.go
parent56ceae9524f40ac89cd68796d1f8e6cd0560c80a (diff)
Instant slider animation
Diffstat (limited to 'cmd/termpicker/main.go')
-rw-r--r--cmd/termpicker/main.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/termpicker/main.go b/cmd/termpicker/main.go
index 0ebbadb..ef9f87f 100644
--- a/cmd/termpicker/main.go
+++ b/cmd/termpicker/main.go
@@ -14,6 +14,16 @@ import (
)
func AppAction(ctx *cli.Context) error {
+ logFile, err := os.Create(ctx.String(flagLogfile))
+ if err != nil {
+ slog.Error("Failed to create log file", util.ErrKey, err.Error())
+ os.Exit(1)
+ }
+ defer logFile.Close()
+
+ handler := slog.NewJSONHandler(logFile, nil)
+ slog.SetDefault(slog.New(handler))
+
slog.Info("Starting Termpicker")
// RGB {{{
r := slider.New('R', 255, progress.WithGradient("#660000", "#ff0000"))