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

Replace import sirupsen/logrus by pkg/log #323

Merged
merged 10 commits into from
Oct 18, 2019
Merged

Replace import sirupsen/logrus by pkg/log #323

merged 10 commits into from
Oct 18, 2019

Conversation

SupriyaKasten
Copy link
Contributor

Change Overview

Replace import sirupsen/logrus by pkg/log

Pull request type

Please check the type of change your PR introduces:

  • Work in Progress
  • Refactoring (no functional changes, no api changes)
  • Trivial/Minor
  • Bugfix
  • Feature
  • Documentation

Issues

  • #XXX

Test Plan

  • Manual
  • Unit test
  • E2E

@tdmanv
Copy link
Contributor

tdmanv commented Oct 16, 2019

cool!

@SupriyaKasten SupriyaKasten marked this pull request as ready for review October 16, 2019 23:19
Copy link
Contributor

@tdmanv tdmanv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please prefer the structured fields over fmt.Sprintf.

cmd/controller/main.go Outdated Show resolved Hide resolved
pkg/blockstorage/awsebs/awsebs.go Outdated Show resolved Hide resolved
@@ -522,7 +523,7 @@ func waitOnVolume(ctx context.Context, ec2Cli *EC2, vol *ec2.Volume) error {
for {
dvo, err := ec2Cli.DescribeVolumesWithContext(ctx, dvi)
if err != nil {
log.Errorf("Failed to describe volume %s Error: %+v", aws.StringValue(vol.VolumeId), err)
log.WithError(err).Print(fmt.Sprintf("Failed to describe volume %s", aws.StringValue(vol.VolumeId)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please avoid using fmt.Sprintf when logging

SupriyaKasten and others added 3 commits October 16, 2019 17:12
Co-Authored-By: Thomas Manville <tom@kasten.io>
Co-Authored-By: Thomas Manville <tom@kasten.io>
@@ -165,7 +167,8 @@ func (c *Controller) onUpdate(oldObj, newObj interface{}) {
c.logAndErrorEvent(nil, "Callback onUpdateBlueprint() failed:", "Error", err, new)
}
default:
log.Errorf("Unknown object type <%T>", oldObj)
objType := fmt.Sprintf("%T", oldObj)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI we can just pass in the object directly. this is fine by me though

Copy link
Contributor

@tdmanv tdmanv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@mergify mergify bot merged commit 007759a into master Oct 18, 2019
@mergify mergify bot deleted the export-log branch October 18, 2019 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants