Skip to content

Commit

Permalink
fix(s3): change zap to Logger interface
Browse files Browse the repository at this point in the history
  • Loading branch information
ripls56 committed Oct 29, 2024
1 parent fa6e3c0 commit 1cf7edb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/server/internal/pkg/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package s3
import (
"context"
"fmt"
"github.com/taskemapp/server/apps/server/internal/pkg/logger"
"time"

"github.com/go-faster/errors"
Expand All @@ -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 {
Expand All @@ -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{})
Expand Down

0 comments on commit 1cf7edb

Please sign in to comment.