-
Notifications
You must be signed in to change notification settings - Fork 17
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
Conversation
The latter uses the new log/slog standard in Go. While we are at it replace deprecated uses of io/ioutil.
@@ -1,3 +1,4 @@ | |||
//go:build go1.12 | |||
// +build go1.12 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Precisely
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Moving this to new internal repo |
The latter uses the new log/slog standard in Go. While we are at it replace deprecated uses of io/ioutil.