Skip to content

Commit c6cf46f

Browse files
committed
chore: migrate from zap to slog
Replace go.uber.org/zap with stdlib log/slog throughout the plugin.
1 parent 966c657 commit c6cf46f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

plugin.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ package fileserver
22

33
import (
44
"context"
5+
"log/slog"
56
"sync"
67
"time"
78

89
"github.com/gofiber/fiber/v2"
910
"github.com/gofiber/fiber/v2/middleware/etag"
1011
"github.com/roadrunner-server/errors"
1112
"github.com/roadrunner-server/tcplisten"
12-
"go.uber.org/zap"
1313
)
1414

1515
const pluginName string = "fileserver"
@@ -22,14 +22,14 @@ type Configurer interface {
2222
}
2323

2424
type Logger interface {
25-
NamedLogger(name string) *zap.Logger
25+
NamedLogger(name string) *slog.Logger
2626
}
2727

2828
type Plugin struct {
2929
sync.Mutex
3030
config *Config
3131

32-
log *zap.Logger
32+
log *slog.Logger
3333
app *fiber.App
3434
}
3535

@@ -95,7 +95,7 @@ func (p *Plugin) Serve() chan error {
9595

9696
go func() {
9797
p.Unlock()
98-
p.log.Info("file server started", zap.String("address", p.config.Address))
98+
p.log.Info("file server started", "address", p.config.Address)
9999
err = p.app.Listener(ln)
100100
if err != nil {
101101
errCh <- err

0 commit comments

Comments
 (0)