Skip to content

Commit 84d6781

Browse files
committed
first attempt, using tint
1 parent 485c714 commit 84d6781

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ require (
88
github.com/google/uuid v1.6.0
99
github.com/inhies/go-bytesize v0.0.0-20220417184213-4913239db9cf
1010
github.com/jedib0t/go-pretty/v6 v6.5.8
11+
github.com/lmittmann/tint v1.0.4
1112
github.com/spf13/cobra v1.8.0
1213
github.com/spf13/pflag v1.0.5
1314
github.com/spf13/viper v1.18.2

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
3434
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
3535
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
3636
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
37+
github.com/lmittmann/tint v1.0.4 h1:LeYihpJ9hyGvE0w+K2okPTGUdVLfng1+nDNVR4vWISc=
38+
github.com/lmittmann/tint v1.0.4/go.mod h1:HIS3gSy7qNwGCj+5oRjAutErFBl4BzdQP6cJZ0NfMwE=
3739
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
3840
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
3941
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=

internal/pkg/print/print.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"os/exec"
1111
"strings"
1212

13+
"github.com/lmittmann/tint"
1314
"github.com/spf13/cobra"
1415
"github.com/spf13/viper"
1516
"github.com/stackitcloud/stackit-cli/internal/pkg/config"
@@ -37,7 +38,7 @@ type Printer struct {
3738

3839
// Creates a new printer, including setting up the default logger.
3940
func NewPrinter() *Printer {
40-
logger := slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{AddSource: false, Level: slog.LevelDebug}))
41+
logger := slog.New(tint.NewHandler(os.Stderr, &tint.Options{AddSource: false, Level: slog.LevelDebug}))
4142
slog.SetDefault(logger)
4243

4344
return &Printer{}

0 commit comments

Comments
 (0)