mirror of
https://github.com/apricote/releaser-pleaser.git
synced 2026-01-13 13:21:00 +00:00
feat: colorize log output
Makes it easier to read, uses lmittmann/tint.
This commit is contained in:
parent
e59b1eb34d
commit
72e1d5a320
3 changed files with 12 additions and 3 deletions
|
|
@ -7,7 +7,9 @@ import (
|
|||
"os/signal"
|
||||
"runtime/debug"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/lmittmann/tint"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
|
|
@ -76,8 +78,12 @@ func Execute() {
|
|||
}
|
||||
|
||||
func init() {
|
||||
logger = slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{
|
||||
logger = slog.New(
|
||||
tint.NewHandler(os.Stderr, &tint.Options{
|
||||
Level: slog.LevelDebug,
|
||||
}))
|
||||
TimeFormat: time.RFC3339,
|
||||
}),
|
||||
)
|
||||
|
||||
slog.SetDefault(logger)
|
||||
}
|
||||
|
|
|
|||
1
go.mod
1
go.mod
|
|
@ -10,6 +10,7 @@ require (
|
|||
github.com/go-git/go-git/v5 v5.16.2
|
||||
github.com/google/go-github/v72 v72.0.0
|
||||
github.com/leodido/go-conventionalcommits v0.12.0
|
||||
github.com/lmittmann/tint v1.1.2
|
||||
github.com/spf13/cobra v1.9.1
|
||||
github.com/stretchr/testify v1.10.0
|
||||
github.com/teekennedy/goldmark-markdown v0.5.1
|
||||
|
|
|
|||
2
go.sum
2
go.sum
|
|
@ -65,6 +65,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
|||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/leodido/go-conventionalcommits v0.12.0 h1:pG01rl8Ze+mxnSSVB2wPdGASXyyU25EGwLUc0bWrmKc=
|
||||
github.com/leodido/go-conventionalcommits v0.12.0/go.mod h1:DW+n8pQb5w/c7Vba7iGOMS3rkbPqykVlnrDykGjlsJM=
|
||||
github.com/lmittmann/tint v1.1.2 h1:2CQzrL6rslrsyjqLDwD11bZ5OpLBPU+g3G/r5LSfS8w=
|
||||
github.com/lmittmann/tint v1.1.2/go.mod h1:HIS3gSy7qNwGCj+5oRjAutErFBl4BzdQP6cJZ0NfMwE=
|
||||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue