Skip to content

Commit

Permalink
Adds more logs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu Leduc-Hamel committed Mar 5, 2021
1 parent 062eb84 commit f21b738
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/jobs/storejob.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (r *StoreJob) Perform(ctx context.Context, args ...interface{}) error {
}
}

r.cfg.Logger().Debug().Msgf("Done processing StoreJob with args %v", args)
r.cfg.Logger().Debug().Interface("args", args).Msg("Done processing StoreJob")
return nil
}

Expand Down
6 changes: 3 additions & 3 deletions pkg/store/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (s *S3) Persist(ctx context.Context, timestamp int64, name string, id strin
datetime := time.Unix(timestamp, 0)
key := fmt.Sprintf("%s/%s/%s.json", name, datetime.Format("20060102"), datetime.Format("1504"))

s.cfg.Logger().Debug().Msgf("Persisting %s", key)
s.cfg.Logger().Debug().Str("key", key).Msg("Starting Persistence")
_, err := s.client.PutObjectWithContext(ctx, &s3.PutObjectInput{
Bucket: aws.String(s.cfg.S3Bucket()),
Key: aws.String(key),
Expand All @@ -81,11 +81,11 @@ func (s *S3) Persist(ctx context.Context, timestamp int64, name string, id strin
ContentType: aws.String("application/json"),
})
if err != nil {
s.cfg.Logger().Error().Err(err).Msgf("Persisting %s: Failed", key)
s.cfg.Logger().Error().Err(err).Str("key", key).Msg("Failed persistence")
return err
}

s.cfg.Logger().Debug().Msgf("Persisting %s: Succeed", key)
s.cfg.Logger().Debug().Str("key", key).Msg("Succeed Persistence")

return nil
}

0 comments on commit f21b738

Please sign in to comment.