From 1cf7edb27b827996ace646a58893a5dddec62f91 Mon Sep 17 00:00:00 2001 From: ripls56 <84716344+ripls56@users.noreply.github.com> Date: Tue, 29 Oct 2024 08:05:15 +0300 Subject: [PATCH] fix(s3): change zap to `Logger` interface --- apps/server/internal/pkg/s3/s3.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/server/internal/pkg/s3/s3.go b/apps/server/internal/pkg/s3/s3.go index 7043c3a..72a68d8 100644 --- a/apps/server/internal/pkg/s3/s3.go +++ b/apps/server/internal/pkg/s3/s3.go @@ -3,6 +3,7 @@ package s3 import ( "context" "fmt" + "github.com/taskemapp/server/apps/server/internal/pkg/logger" "time" "github.com/go-faster/errors" @@ -24,7 +25,7 @@ func New(cfg Config) (*minio.Client, error) { return c, nil } -func Invoke(lc fx.Lifecycle, log *zap.Logger, cfg Config, c *minio.Client) { +func Invoke(lc fx.Lifecycle, log logger.Logger, cfg Config, c *minio.Client) { lc.Append( fx.Hook{ OnStart: func(ctx context.Context) error { @@ -37,7 +38,7 @@ func Invoke(lc fx.Lifecycle, log *zap.Logger, cfg Config, c *minio.Client) { return fmt.Errorf("cannot list buckets: %w", err) } - log.Sugar().Debug("Bucket exist: ", ok) + log.Debug("Bucket exist: ", zap.Bool("exist", ok)) if !ok { err = c.MakeBucket(ctx, cfg.Bucket, minio.MakeBucketOptions{})