Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(aws): refine S3 connector logs #145

Merged
merged 1 commit into from
Sep 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions aws/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
Loading