We use SpanLogger to unify logging and tracing instrumentation code, but we need to call level.Error and log.Error to log and set the error tag on the span in the case of errors. We can keep the current Log and Error functions to satisfy the interfaces but extend Log (or introduce a new function) to detect level=error in the key value pairs passed to the function to also call Error and save users a loc per error handling branch
See discussion starting here: #2970 (comment)
cc @pstibrany @pracucci
We use SpanLogger to unify logging and tracing instrumentation code, but we need to call
level.Errorandlog.Errorto log and set the error tag on the span in the case of errors. We can keep the currentLogandErrorfunctions to satisfy the interfaces but extendLog(or introduce a new function) to detectlevel=errorin the key value pairs passed to the function to also callErrorand save users a loc per error handling branchSee discussion starting here: #2970 (comment)
cc @pstibrany @pracucci