Skip to content

Commit

Permalink
feat: use tint for logging
Browse files Browse the repository at this point in the history
commit-id:c24abd1e
  • Loading branch information
martinohansen committed Sep 16, 2024
1 parent c582615 commit 92d0ed7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/ynabber/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/carlmjohnson/versioninfo"
"github.com/kelseyhightower/envconfig"
"github.com/lmittmann/tint"
"github.com/martinohansen/ynabber"
"github.com/martinohansen/ynabber/reader/nordigen"
"github.com/martinohansen/ynabber/writer/json"
Expand All @@ -20,8 +21,8 @@ func setupLogging(debug bool) {
if debug {
programLevel = slog.LevelDebug
}
logger := slog.New(slog.NewTextHandler(
os.Stderr, &slog.HandlerOptions{
logger := slog.New(tint.NewHandler(
os.Stderr, &tint.Options{
Level: programLevel,
}))
slog.SetDefault(logger)
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ require github.com/frieser/nordigen-go-lib/v2 v2.1.7
require github.com/kelseyhightower/envconfig v1.4.0

require github.com/carlmjohnson/versioninfo v0.22.5

require github.com/lmittmann/tint v1.0.5
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ github.com/frieser/nordigen-go-lib/v2 v2.1.7 h1:n6qhksPY9iPPXBmbdnIxwWQeaMM2fsQe
github.com/frieser/nordigen-go-lib/v2 v2.1.7/go.mod h1:NejYisqD8GvynCN0vDGw7J66slnj7jB25c8tS1tr8bw=
github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8=
github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg=
github.com/lmittmann/tint v1.0.5 h1:NQclAutOfYsqs2F1Lenue6OoWCajs5wJcP3DfWVpePw=
github.com/lmittmann/tint v1.0.5/go.mod h1:HIS3gSy7qNwGCj+5oRjAutErFBl4BzdQP6cJZ0NfMwE=

0 comments on commit 92d0ed7

Please sign in to comment.