Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
black-adder committed May 24, 2017
1 parent 7836d13 commit 7464ea0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions span.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ func (s *Span) LogFields(fields ...log.Field) {
if !s.context.IsSampled() {
return
}
s.logFieldsWithLock(fields...)
s.logFieldsNoLocking(fields...)
}

// this function should only be called while holding a Write lock
func (s *Span) logFieldsWithLock(fields ...log.Field) {
func (s *Span) logFieldsNoLocking(fields ...log.Field) {
lr := opentracing.LogRecord{
Fields: fields,
Timestamp: time.Now(),
Expand Down Expand Up @@ -182,7 +182,7 @@ func (s *Span) SetBaggageItem(key, value string) opentracing.Span {
return s
}
// If sampled, record the baggage in the span
s.logFieldsWithLock(
s.logFieldsNoLocking(
log.String("event", "baggage"),
log.String("key", key),
log.String("value", value),
Expand Down
2 changes: 1 addition & 1 deletion span_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func assertBaggageRecords(t *testing.T, sp *Span, expected map[string]string) {
value := logRecord.Fields[2].Value().(string)

require.Contains(t, expected, key)
assert.Equal(t, value, expected[key])
assert.Equal(t, expected[key], value)
}
}

Expand Down

0 comments on commit 7464ea0

Please sign in to comment.