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

Track2: azcore log remove some duplicate code #14549

Merged
merged 2 commits into from
Apr 20, 2021

Conversation

magodo
Copy link
Contributor

@magodo magodo commented Apr 19, 2021

The PR removes some duplicate code in azcore log.go:

  • Remove the check on l.lst in Logger.Writef as it is checked in Logger.Should already
  • Reuse Logger.Writef in Logger.Write to DRY.
  • The purpose of this PR is explained in this or a referenced issue.
  • The PR does not update generated files.
  • Tests are included and/or updated for code changes.
  • Updates to CHANGELOG.md are included.
  • MIT license headers are included in each file.

@magodo magodo changed the title azcore: log remove some duplicate code Track2: azcore log remove some duplicate code Apr 19, 2021
@magodo magodo added the Track2 label Apr 19, 2021
return
}
l.lst(cls, message)
l.Writef(cls, "%s", message)
Copy link
Member

Choose a reason for hiding this comment

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

The call to l.lst() in this case was intentional, to avoid interpreting any % characters as format specifiers (URL-encoded query params will contain them).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've revert this.

@jhendrixMSFT jhendrixMSFT merged commit 4062916 into Azure:master Apr 20, 2021
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.

2 participants