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

all: replace segmentio/events with segmentio/log #143

Closed
wants to merge 1 commit into from

Conversation

kevinburkesegment
Copy link
Contributor

The latter uses the new log/slog standard in Go. While we are at it replace deprecated uses of io/ioutil.

The latter uses the new log/slog standard in Go. While we are at it
replace deprecated uses of io/ioutil.
@kevinburkesegment kevinburkesegment requested a review from a team as a code owner February 26, 2024 22:16
@@ -1,3 +1,4 @@
//go:build go1.12
// +build go1.12
Copy link
Collaborator

@erikdw erikdw Feb 26, 2024

Choose a reason for hiding this comment

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

Does this obviate line 2, or is it somehow a different thing?

Copy link
Collaborator

@erikdw erikdw Feb 26, 2024

Choose a reason for hiding this comment

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

Ah, GitHub Copilot to the rescue.

image

Warning

I wonder if we can get rid of the older-style directive... I guess it would break if one of our client applications is still building with Go version less than 1.17.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Precisely

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'm not sure I've seen anything as old as 1.17, but probably better safe than sorry

@@ -206,7 +206,7 @@ func (l *dbLimiter) refreshWriterLimits(ctx context.Context) error {
if err != nil {
return errors.Wrap(err, "adjust found rate limit")
}
events.Debug("adjusted %v limit from %v/%v to %v/%v", writerName, maxRowsPerMinute, time.Minute, adjustedRate, l.defaultWriterLimit.Period)
log.EventDebug("adjusted %v limit from %v/%v to %v/%v", writerName, maxRowsPerMinute, time.Minute, adjustedRate, l.defaultWriterLimit.Period)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are some events.Debug changed to log.Debug and some log.EventDebug?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@janderson-seg : Hmm, I don't see any log.Debug lines, can you point one out please?

Copy link
Contributor

Choose a reason for hiding this comment

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

Lines 117 and 209 show an example of this. The source call was events.Debug and on line 117 log.Debug was used and on line 209 log.EventDebug was used.

@erikdw
Copy link
Collaborator

erikdw commented Mar 1, 2024

Moving this to new internal repo

@erikdw erikdw closed this Mar 1, 2024
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.

3 participants