summaryrefslogtreecommitdiff
path: root/internal/logging/logging.go
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2025-03-26 17:28:58 -0400
committerGitHub <noreply@github.com>2025-03-26 17:28:58 -0400
commitd2fdcbc0d4f8b4c184ba2b1c3c4b00da3918521f (patch)
tree6f4ba628fffb5e6d84f2eaa756345d3307abab77 /internal/logging/logging.go
parentcd9338e0d6cf582f9ea8028661ac3729e408f3bf (diff)
Stylish `--help` + generate manpages (#27)v1.3.7
* man page generation * generate VHS Gifs manually * goreleaser packages manpage
Diffstat (limited to 'internal/logging/logging.go')
-rw-r--r--internal/logging/logging.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/internal/logging/logging.go b/internal/logging/logging.go
index 71f0334..054b303 100644
--- a/internal/logging/logging.go
+++ b/internal/logging/logging.go
@@ -7,12 +7,6 @@ import (
"github.com/ChausseBenjamin/termpicker/internal/util"
)
-type logSink struct{}
-
-func (l logSink) Write(p []byte) (n int, err error) {
- return len(p), nil
-}
-
func Setup(filepath string) *os.File {
if filepath != "" {
logFile, err := os.Create(filepath)
@@ -28,7 +22,7 @@ func Setup(filepath string) *os.File {
} else {
// Since app is a TUI, logging to stdout/stderr would break the UI
// So we disable it by default
- handler := slog.NewJSONHandler(logSink{}, nil)
+ handler := DiscardHandler{}
slog.SetDefault(slog.New(handler))
return nil
}