Skip to content

Commit 430cffd

Browse files
committed
use standard log/slog instead of zerolog
1 parent e411801 commit 430cffd

File tree

13 files changed

+52
-71
lines changed

13 files changed

+52
-71
lines changed

README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,10 @@ Look at the [default config](internal/config/default.config.toml) for other valu
9494

9595
## Logging
9696

97-
Because logging to STDOUT is pointless because STDOUT is already used for the UI output, you can find log messages in a file called `blimp.log`.
97+
Blimp will log errors and warning to STDERR. Because STDOUT is already used for the UI it can be hard to spot the errors.
9898

99-
If you want blimp to write to a different logfile you can set it in the config like this:
99+
To be able to see the log messages you can redirect the STDERR output to a file:
100100

101-
```toml
102-
[logging]
103-
filename = "blimp.log"
101+
```shell
102+
blimp 2>> blimp.log
104103
```

go.mod

-4
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ require (
1313
github.com/mmcdole/gofeed v1.2.1
1414
github.com/prometheus-community/pro-bing v0.3.0
1515
github.com/rivo/tview v0.0.0-20230826141931-7344139b5532
16-
github.com/rs/zerolog v1.30.0
17-
gopkg.in/natefinch/lumberjack.v2 v2.2.1
1816
)
1917

2018
require (
@@ -26,8 +24,6 @@ require (
2624
github.com/json-iterator/go v1.1.12 // indirect
2725
github.com/knadh/koanf/maps v0.1.1 // indirect
2826
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
29-
github.com/mattn/go-colorable v0.1.12 // indirect
30-
github.com/mattn/go-isatty v0.0.14 // indirect
3127
github.com/mattn/go-runewidth v0.0.14 // indirect
3228
github.com/mitchellh/copystructure v1.2.0 // indirect
3329
github.com/mitchellh/mapstructure v1.5.0 // indirect

go.sum

-14
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ github.com/PuerkitoBio/goquery v1.8.0 h1:PJTF7AmFCFKk1N6V6jmKfrNH9tV5pNE6lZMkG0g
22
github.com/PuerkitoBio/goquery v1.8.0/go.mod h1:ypIiRMtY7COPGk+I/YbZLbxsxn9g5ejnI2HSMtkjZvI=
33
github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c=
44
github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA=
5-
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
65
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
76
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
87
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -12,7 +11,6 @@ github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdk
1211
github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
1312
github.com/gdamore/tcell/v2 v2.6.0 h1:OKbluoP9VYmJwZwq/iLb4BxwKcwGthaa1YNBJIyCySg=
1413
github.com/gdamore/tcell/v2 v2.6.0/go.mod h1:be9omFATkdr0D9qewWW3d+MEvl5dha+Etb5y65J2H8Y=
15-
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
1614
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
1715
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
1816
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
@@ -34,10 +32,6 @@ github.com/knadh/koanf/v2 v2.0.1 h1:1dYGITt1I23x8cfx8ZnldtezdyaZtfAuRtIFOiRzK7g=
3432
github.com/knadh/koanf/v2 v2.0.1/go.mod h1:ZeiIlIDXTE7w1lMT6UVcNiRAS2/rCeLn/GdLNvY1Dus=
3533
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
3634
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
37-
github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40=
38-
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
39-
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
40-
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
4135
github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU=
4236
github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
4337
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
@@ -57,7 +51,6 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
5751
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
5852
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
5953
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
60-
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
6154
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
6255
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
6356
github.com/prometheus-community/pro-bing v0.3.0 h1:SFT6gHqXwbItEDJhTkzPWVqU6CLEtqEfNAPp47RUON4=
@@ -67,9 +60,6 @@ github.com/rivo/tview v0.0.0-20230826141931-7344139b5532/go.mod h1:nVwGv4MP47T0j
6760
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
6861
github.com/rivo/uniseg v0.4.3 h1:utMvzDsuh3suAEnhH0RdHmoPbU648o6CvXxTx4SBMOw=
6962
github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
70-
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
71-
github.com/rs/zerolog v1.30.0 h1:SymVODrcRsaRaSInD9yQtKbtWqwsfoPcRff/oRXLj4c=
72-
github.com/rs/zerolog v1.30.0/go.mod h1:/tk+P47gFdPXq4QYjvCmT5/Gsug2nagsFWBWhAiSi1w=
7363
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
7464
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
7565
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
@@ -91,8 +81,6 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h
9181
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
9282
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
9383
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
94-
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
95-
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
9684
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
9785
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
9886
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -115,6 +103,4 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm
115103
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
116104
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
117105
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
118-
gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc=
119-
gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc=
120106
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

internal/config/config.go

+7-3
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ package config
22

33
import (
44
"errors"
5+
"fmt"
56
"os"
67
"strings"
78

9+
"log/slog"
10+
811
"github.com/knadh/koanf/parsers/toml"
912
"github.com/knadh/koanf/providers/env"
1013
"github.com/knadh/koanf/providers/file"
1114
"github.com/knadh/koanf/v2"
12-
"github.com/rs/zerolog/log"
1315
)
1416

1517
var K = koanf.New(".")
@@ -32,14 +34,16 @@ func InitConfig() {
3234

3335
if err := K.Load(file.Provider(configName), toml.Parser()); err != nil {
3436
if !errors.Is(err, os.ErrNotExist) {
35-
log.Panic().Err(err).Msgf("Failed to load config file %s", configName)
37+
slog.With("error", err).Error(fmt.Sprintf("Failed to load config file %s", configName))
38+
panic(err)
3639
}
3740
}
3841

3942
if err := K.Load(env.Provider(envVarPrefix, ".", func(s string) string {
4043
return strings.Replace(strings.ToLower(
4144
strings.TrimPrefix(s, envVarPrefix)), "_", ".", -1)
4245
}), nil); err != nil {
43-
log.Panic().Err(err).Msgf("Failed to load env vars")
46+
slog.With("error", err).Error("Failed to load config from environment")
47+
panic(err)
4448
}
4549
}

internal/config/default.config.toml

-6
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,3 @@ update_interval = 60000 # 1 minutes
3333
max_items = 0 # 0 means auto
3434
show_feed_title = true
3535
show_published_time = true
36-
37-
[logging]
38-
filename = "blimp.log"
39-
max_size = 1 # in MB
40-
max_age = 7 # in days
41-
max_backups = 5 # // note: old ones will still be deleted after max_age

internal/config/defaults.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@ package config
22

33
import (
44
_ "embed"
5+
"log/slog"
56

67
"github.com/knadh/koanf/parsers/toml"
78
"github.com/knadh/koanf/providers/rawbytes"
8-
"github.com/rs/zerolog/log"
99
)
1010

1111
//go:embed default.config.toml
1212
var defaultConfigTomlBytes []byte
1313

1414
func setupDefaults() {
1515
if err := K.Load(rawbytes.Provider(defaultConfigTomlBytes), toml.Parser()); err != nil {
16-
log.Panic().Err(err).Msgf("Failed to load default config")
16+
slog.With("error", err).Error("Failed to load default config")
17+
panic(err)
1718
}
1819
}

internal/logging/logging.go

+8-19
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,21 @@
11
package logging
22

33
import (
4-
"io"
4+
"log/slog"
55
"os"
66

77
"github.com/merlinfuchs/blimp/internal/config"
8-
"github.com/rs/zerolog"
9-
"github.com/rs/zerolog/log"
10-
"gopkg.in/natefinch/lumberjack.v2"
118
)
129

1310
func InitLogger() {
14-
logContext := log.With()
15-
16-
logWriters := make([]io.Writer, 0)
17-
logWriters = append(logWriters, &lumberjack.Logger{
18-
Filename: config.K.String("logging.filename"),
19-
MaxSize: config.K.Int("logging.max_size"),
20-
MaxAge: config.K.Int("logging.max_age"),
21-
MaxBackups: config.K.Int("logging.max_backups"),
22-
})
11+
logLevel := slog.LevelInfo
2312
if config.K.Bool("debug") {
24-
zerolog.SetGlobalLevel(zerolog.DebugLevel)
25-
logWriters = append(logWriters, zerolog.ConsoleWriter{Out: os.Stdout})
26-
} else {
27-
zerolog.SetGlobalLevel(zerolog.InfoLevel)
13+
logLevel = slog.LevelDebug
2814
}
2915

30-
writer := io.MultiWriter(logWriters...)
31-
log.Logger = logContext.Logger().Output(writer)
16+
logger := slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{
17+
Level: logLevel,
18+
}))
19+
20+
slog.SetDefault(logger)
3221
}

internal/widgets/feeds/feeds.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ package feeds
33
import (
44
"context"
55
"fmt"
6+
"log/slog"
67
"sort"
78
"time"
89

910
"github.com/mmcdole/gofeed"
10-
"github.com/rs/zerolog/log"
1111

1212
"github.com/gdamore/tcell/v2"
1313
"github.com/merlinfuchs/blimp/internal/config"
@@ -24,7 +24,8 @@ type FeedsView struct {
2424
func New() *FeedsView {
2525
targets := make([]FeedTarget, 0)
2626
if err := config.K.Unmarshal("widgets.feeds.targets", &targets); err != nil {
27-
log.Panic().Err(err).Msgf("Failed to unmarshal status targets")
27+
slog.With("error", err).Error("Failed to unmarshal status targets")
28+
panic(err)
2829
}
2930

3031
view := tview.NewFlex().SetDirection(tview.FlexRow)
@@ -66,7 +67,7 @@ func (l *FeedsView) updateItems() {
6667

6768
feed, err := fp.ParseURLWithContext(target.URL, ctx)
6869
if err != nil {
69-
log.Error().Err(err).Msgf("Failed to fetch feed %s", target.URL)
70+
slog.With("error", err).Error("Failed to fetch feed", "url", target.URL)
7071
continue
7172
}
7273

@@ -82,7 +83,7 @@ func (l *FeedsView) updateItems() {
8283
publishedI := items[i].Item.PublishedParsed
8384
publishedJ := items[j].Item.PublishedParsed
8485
if publishedI == nil || publishedJ == nil {
85-
log.Warn().Msgf("Failed to sort feeds, missing published date")
86+
slog.Warn("Failed to sort feeds, missing published date")
8687
return true
8788
}
8889
return publishedI.After(*publishedJ)

internal/widgets/latency/latency.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ package latency
33
import (
44
"time"
55

6+
"log/slog"
7+
68
"github.com/gdamore/tcell/v2"
79
"github.com/guptarohit/asciigraph"
810
"github.com/merlinfuchs/blimp/internal/config"
911
ping "github.com/prometheus-community/pro-bing"
1012
"github.com/rivo/tview"
11-
"github.com/rs/zerolog/log"
1213
)
1314

1415
type LatencyView struct {
@@ -51,7 +52,7 @@ func (l *LatencyView) Start() {
5152
var err error
5253
pinger, err = ping.NewPinger(config.K.String("widgets.latency.target_host"))
5354
if err != nil {
54-
log.Error().Err(err).Msgf("Failed to create pinger")
55+
slog.With("error", err).Error("Failed to create pinger")
5556
return
5657
}
5758

@@ -65,7 +66,7 @@ func (l *LatencyView) Start() {
6566

6667
err = pinger.Run()
6768
if err != nil {
68-
log.Error().Err(err).Msgf("Failed to run pinger, latency won't be displayed")
69+
slog.With("error", err).Error("Failed to run pinger, latency won't be displayed")
6970
}
7071
}
7172
}

internal/widgets/status/status.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ package status
33
import (
44
"context"
55
"fmt"
6+
"log/slog"
67
"net/http"
78
"time"
89

9-
"github.com/rs/zerolog/log"
10-
1110
"github.com/gdamore/tcell/v2"
1211
"github.com/merlinfuchs/blimp/internal/config"
1312
ping "github.com/prometheus-community/pro-bing"
@@ -24,7 +23,8 @@ type StatusView struct {
2423
func New() *StatusView {
2524
targets := make([]StatusTarget, 0)
2625
if err := config.K.Unmarshal("widgets.status.targets", &targets); err != nil {
27-
log.Panic().Err(err).Msgf("Failed to unmarshal status targets")
26+
slog.With("error", err).Error("Failed to unmarshal status targets")
27+
panic(err)
2828
}
2929

3030
view := tview.NewFlex().SetDirection(tview.FlexRow)
@@ -79,8 +79,8 @@ func (l *StatusView) updateData() {
7979
case "ping":
8080
pinger, err := ping.NewPinger(target.Host)
8181
if err != nil {
82-
log.Fatal().Err(err).Msgf("Failed to create pinger, latency won't be displayed")
83-
return
82+
slog.With("error", err).Error("Failed to create pinger, latency won't be displayed")
83+
panic(err)
8484
}
8585

8686
pinger.SetPrivileged(false)
@@ -104,7 +104,7 @@ func (l *StatusView) updateData() {
104104
}
105105
}
106106
default:
107-
log.Error().Msgf("Unknown status target type %s", target.Type)
107+
slog.Error(fmt.Sprintf("Unknown status target type %s", target.Type))
108108
}
109109
}
110110
}

internal/widgets/weather/api.go

+8
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ func getCurrentWeatherData() (CurrentWeatherData, error) {
6060
return CurrentWeatherData{}, fmt.Errorf("Failed to get weather data, %w", err)
6161
}
6262

63+
if resp.StatusCode >= 300 || resp.StatusCode < 200 {
64+
return CurrentWeatherData{}, fmt.Errorf("Failed to get current weather data, status code %d", resp.StatusCode)
65+
}
66+
6367
var data CurrentWeatherData
6468
if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
6569
return CurrentWeatherData{}, fmt.Errorf("Failed to decode weather data, %w", err)
@@ -83,6 +87,10 @@ func getWeatherForecast() (ForecastWeatherData, error) {
8387
return ForecastWeatherData{}, fmt.Errorf("Failed to get weather data, %w", err)
8488
}
8589

90+
if resp.StatusCode >= 300 || resp.StatusCode < 200 {
91+
return ForecastWeatherData{}, fmt.Errorf("Failed to get weather forecast data, status code %d", resp.StatusCode)
92+
}
93+
8694
var data ForecastWeatherData
8795
if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
8896
return ForecastWeatherData{}, fmt.Errorf("Failed to decode weather data, %w", err)

internal/widgets/weather/weather.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ import (
44
"fmt"
55
"time"
66

7+
"log/slog"
8+
79
"github.com/gdamore/tcell/v2"
810
"github.com/merlinfuchs/blimp/internal/config"
911
"github.com/merlinfuchs/blimp/internal/widgets/weather/icons"
1012
"github.com/rivo/tview"
11-
"github.com/rs/zerolog/log"
1213
)
1314

1415
type StatusView struct {
@@ -60,14 +61,14 @@ func (l *StatusView) updateData() {
6061

6162
currentWeather, err := getCurrentWeatherData()
6263
if err != nil {
63-
log.Error().Err(err).Msgf("Failed to get current weather data")
64+
slog.With("error", err).Error("Failed to get current weather data", "error")
6465
return
6566
}
6667
l.currentWeather = &currentWeather
6768

6869
forecastWeather, err := getWeatherForecast()
6970
if err != nil {
70-
log.Error().Err(err).Msgf("Failed to get forecast weather data")
71+
slog.With("error", err).Error("Failed to get weather forecast data")
7172
return
7273
}
7374
l.forecastWeather = &forecastWeather

main.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ package main
33
import (
44
"fmt"
55

6+
"log/slog"
7+
68
"github.com/merlinfuchs/blimp/internal"
79
"github.com/merlinfuchs/blimp/internal/config"
810
"github.com/merlinfuchs/blimp/internal/logging"
9-
"github.com/rs/zerolog/log"
1011
)
1112

1213
var outDatedConfigKeys = []string{
@@ -27,6 +28,6 @@ func main() {
2728

2829
err := internal.AppEntry()
2930
if err != nil {
30-
log.Fatal().Err(err).Msg("Failed to start app")
31+
slog.With("error", err).Error("Failed to start blimp")
3132
}
3233
}

0 commit comments

Comments
 (0)