Skip to content

Commit 16578c5

Browse files
authored
Merge pull request #8 from fuyibing/2.x
no message
2 parents d2d5453 + 981dcbe commit 16578c5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

context.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@ func ChildContext(ctx interface{}, text string, args ...interface{}) context.Con
4040
return NewContext()
4141
}
4242
// 3. generate child tracing.
43-
prefix := ""
44-
if text != "" {
45-
prefix = fmt.Sprintf(text, args...) + " "
43+
if text == "" {
44+
text = "new span"
45+
} else {
46+
text = fmt.Sprintf(text, args...)
4647
}
47-
Infofc(ctx, prefix+"build child span.")
48+
49+
Infofc(ctx, text)
4850
ctn := context.WithValue(context.TODO(), interfaces.OpenTracingKey, NewTracing().Use(t.GetTraceId(), t.GenPreviewVersion()))
49-
Infofc(ctn, prefix+"child span builded.")
5051
return ctn
5152
}

0 commit comments

Comments
 (0)