From ada6d8c7abb76226995c7c5f3be8141d75da1f25 Mon Sep 17 00:00:00 2001 From: reugn Date: Sat, 14 Sep 2024 20:53:08 +0300 Subject: [PATCH] chore(aws): refine S3 connector logs --- aws/s3.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aws/s3.go b/aws/s3.go index ffd3002..c808a3a 100644 --- a/aws/s3.go +++ b/aws/s3.go @@ -151,7 +151,7 @@ func (s *S3Source) getObjects(ctx context.Context) { Data: bytes.NewReader(data), } case <-ctx.Done(): - s.logger.Debug("Object reading finished", slog.Any("error", ctx.Err())) + s.logger.Debug("Object reading terminated", slog.Any("error", ctx.Err())) break loop } } @@ -208,7 +208,7 @@ type S3Sink struct { var _ streams.Sink = (*S3Sink)(nil) // NewS3Sink returns a new [S3Sink]. -// Incoming elements are expected to be of the [S3PutObject] type. These will +// Incoming elements are expected to be of the [S3Object] type. These will // be uploaded to the configured bucket using their key field as the path. func NewS3Sink(ctx context.Context, client *s3.Client, config *S3SinkConfig, logger *slog.Logger) *S3Sink { @@ -278,10 +278,10 @@ func (s *S3Sink) writeObject(ctx context.Context, putObject *S3Object) error { Body: putObject.Data, }) if err != nil { - return fmt.Errorf("failed to put object: %w", err) + return fmt.Errorf("failed to put object %s: %w", putObject.Key, err) } - s.logger.Debug("Successfully put object", slog.String("key", putObject.Key), + s.logger.Debug("Object successfully stored", slog.String("key", putObject.Key), slog.Any("etag", putObjectOutput.ETag)) return nil