File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -228,10 +228,10 @@ func (el *eventLogger) SetTags(ctx context.Context, tags map[string]interface{})
228
228
}
229
229
}
230
230
231
- func (el * eventLogger ) SetErr (ctx context.Context , err error ) {
231
+ func (el * eventLogger ) setErr (ctx context.Context , err error , skip int ) {
232
232
span := opentrace .SpanFromContext (ctx )
233
233
if span == nil {
234
- _ , file , line , _ := runtime .Caller (1 )
234
+ _ , file , line , _ := runtime .Caller (skip )
235
235
log .Errorf ("SetErr with no Span in context called on %s:%d" , path .Base (file ), line )
236
236
return
237
237
}
@@ -243,6 +243,10 @@ func (el *eventLogger) SetErr(ctx context.Context, err error) {
243
243
span .LogKV ("error" , err .Error ())
244
244
}
245
245
246
+ func (el * eventLogger ) SetErr (ctx context.Context , err error ) {
247
+ el .setErr (ctx , err , 1 )
248
+ }
249
+
246
250
func (el * eventLogger ) Finish (ctx context.Context ) {
247
251
span := opentrace .SpanFromContext (ctx )
248
252
if span == nil {
@@ -254,7 +258,7 @@ func (el *eventLogger) Finish(ctx context.Context) {
254
258
}
255
259
256
260
func (el * eventLogger ) FinishWithErr (ctx context.Context , err error ) {
257
- el .SetErr (ctx , err )
261
+ el .setErr (ctx , err , 2 )
258
262
el .Finish (ctx )
259
263
}
260
264
You can’t perform that action at this time.
0 commit comments